bulk convert to u-law or a-law audio format


The telephone system requires often audio prompts in u-law or a-law format.
To convert all your wav files you can execute following command in the directory with wav files,
it will convert file and save it with the same file name and new extension

# for a in *.wav; do sox "$a" -t raw -r 8000 -c 1 -e u-law ${a/.wav/.ulaw} ; done

or 

# for a in *.wav; do sox "$a" -t raw -r 8000 -c 1 -e a-law ${a/.wav/.alaw} ; done

Enjoy!

No comments:

Asterisk AST_SORCERY function

 AST_SORCERY gets a field from a sorcery object. Sorcery is always created for PJSIP aors, endpoints and identifies in asterisk. It allows y...