User Tools

Site Tools


voip:create_moh_files

This is an old revision of the document!


Quick script to convert .mp3 files to .wav

convertsongs.sh
#!/bin/bash
IFSORG=$IFS
IFS=$'\n';
for x in `ls *.mp3`; do
# Convert the name to something FS can use
	SONGNAME=`echo $x | tr " " _ | sed 's/\.mp3/\.wav/'`

# Now convert 'em songs son!
	echo "Converting $x:";
	echo "8000 HZ..";
	mpg123 -q -s -f 8192 --mono -r 8000 -w "8000_$SONGNAME" $x
	echo "16000 HZ..";
	mpg123 -q -s -f 8192 --mono -r 16000 -w "16000_$SONGNAME" $x
	echo "32000 HZ..";
	mpg123 -q -s -f 8192 --mono -r 32000 -w "32000_$SONGNAME" $x
	echo "48000 HZ..";
	mpg123 -q -s -f 8192 --mono -r 48000 -w "48000_$SONGNAME" $x
done
IFS=$IFSORG

echo "Done converting."
voip/create_moh_files.1385640012.txt.gz · Last modified: 2015/08/15 22:56 (external edit)

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki