Posted By

whitetiger on 11/09/06


Tagged

Shell Bash unix osx linux cli ssh perl dangerous mandrake


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

alexxx


Bash - mp32wav


 / Published in: Bash
 

  1. #!/bin/sh
  2.  
  3. ### Tools usati
  4. MKDIR=`which mkdir`
  5. MPG321=`which mpg321`
  6. SOX=`which sox`
  7. RM=`which rm`
  8. CLEAR=`which clear`
  9.  
  10. ### Variabili
  11. NUM_TRACKS=0
  12.  
  13. if [ -z "$1" ]; then
  14.  
  15. $CLEAR
  16. echo
  17. echo "----------------------------------"
  18. echo " Uso: $0 <directory_MP3>"
  19. echo "----------------------------------"
  20. echo
  21.  
  22. exit 0
  23.  
  24. fi
  25.  
  26. if [ ! -d "Traccie_Audio" ]; then
  27.  
  28. $MKDIR "Traccie_Audio"
  29.  
  30. fi
  31.  
  32. for I in "$1"*.mp3 # Prende la directory contenente l'album
  33. do
  34.  
  35. NUM_TRACKS=$[ $NUM_TRACKS + 1 ] # Incrementa il numero di Traccia
  36.  
  37. $CLEAR
  38. echo
  39. echo "--------------------------------------------------------------------------------------------------"
  40. echo " [$NUM_TRACKS] --> Conversione di "$I""
  41. echo "--------------------------------------------------------------------------------------------------"
  42. echo
  43.  
  44. $MPG321 -v --cdr - "$I" > "Traccie_Audio"/$NUM_TRACKS.cdr # Converti un MP3 in WAV
  45. $SOX -r 44100 "Traccie_Audio"/$NUM_TRACKS.cdr "Traccie_Audio"/$NUM_TRACKS.wav # Fai il resample delle frequenze
  46.  
  47. $RM -f "Traccie_Audio"/$NUM_TRACKS.cdr
  48.  
  49. done
  50.  
  51. $CLEAR
  52. echo
  53. echo "----------------------------------------"
  54. echo " Finita la conversione dei file..."
  55. echo "----------------------------------------"
  56. echo " -----------------------------------"
  57. echo " Ora puoi Masterizzare il CD-Audio"
  58. echo " -----------------------------------"
  59. echo

Report this snippet  

You need to login to post a comment.