Convert Asterisk GSM encoded WAV files to MP3


/ Published in: Bash
Save to your folder(s)



Copy this code and paste it in your HTML
  1. #!/bin/bash
  2. if which sox >/dev/null; then
  3. echo We have sox..continuing
  4. else
  5. echo Exiting..please install sox.
  6. exit 1
  7. fi
  8.  
  9. if which lame >/dev/null; then
  10. echo We have lame..continuing
  11. else
  12. echo Exiting..please install lame.
  13. exit 1
  14. fi
  15.  
  16.  
  17. for input in *.WAV;
  18. do
  19. pcmwav=$(basename $input .WAV).wav
  20. mp3=$(basename $pcmwav .wav).mp3
  21. sox $input -s $pcmwav
  22. lame $pcmwav $mp3
  23. rm $input
  24. rm $pcmwav
  25. done

URL: http://techpoet.blogspot.com/2010/02/batch-convert-asterisk-wav-files-to-mp3.html

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.