asterisk sound conversion script from .aiff to .gsm, .alaw, .ulaw and 16 bit .wav using sox
#!/bin/bash
for a in $(find . -name '*.aiff'); do
sox --norm $a -t gsm -r 8k -c 1 `echo $a|sed "s/.aiff/.gsm/"`;\
sox --norm $a -t raw -r 8k -c 1 -e a-law `echo $a|sed "s/.aiff/.alaw/"`;\
sox --norm $a -t raw -r 8k -c 1 -e u-law `echo $a|sed "s/.aiff/.ulaw/"`;\
# sox --norm $a -t wav -r 8k -c 1 -e signed-integer `echo $a|sed "s/.aiff/.WAV/"`;\
sox --norm $a -r 16k -c 1 -e signed-integer -b 16 `echo $a|sed "s/.aiff/.wav/"`;\
done