Posted By

ernestoongaro on 02/16/10


wav mp3 gsm Sox asterisk lame

Versions (?)

Convert Asterisk GSM encoded WAV files to MP3

 / Published in: Bash


  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
  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
  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  


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?

Posted By: wonderfullifeness on May 13, 2015

Here is just a simple guide on how to convert GSM to MP3, WAV, WMA, AAC, M4A etc at

You need to login to post a comment.