#!/bin/sh if [ -z "$1" -o "$1" = "-h" ]; then cat << HELPMSG amr2wav -- convert amr from Ericsson or Nokia phone to wav USAGE: amr2wav [-h] file1.amr file2.amr .... EXAMPLE: amr2wav *.amr OPTIONS: -h this help This script uses the amr codec from http://www.3gpp.org/ftp/Specs/2003-09/Rel-5/26_series/26104-520.zip Please use the lame software if you want to convert the .wav file into mp3. HELPMSG exit 0 fi for ifile in "$@"; do if echo "$ifile" | egrep -q "\.amr" ; then mfile=`echo "$ifile" | sed -e "s/\.amr//"`; echo "processing $ifile ..." amr_decoder $ifile $mfile-$$-.raw sox -r 8000 -w -c 1 -s $mfile-$$-.raw -r 16000 -w -c 1 $mfile.wav else echo "File $ifile does not end in .amr, ignored..." fi done