Posted By

ernestoongaro on 02/16/10


Tagged

wav mp3 gsm Sox asterisk lame


Versions (?)

Convert Asterisk GSM encoded WAV files to MP3


 / Published in: Bash
 

URL: http://techpoet.blogspot.com/2010/02/batch-convert-asterisk-wav-files-to-mp3.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

Report this snippet  

Comments

RSS Icon Subscribe to comments
Posted By: mos33 on May 10, 2012

where's the path to set this script? or it will run from cron job?

You need to login to post a comment.