AstRecipes » Script to convert music-on-hold to native formats
This script converts a directory full of MP3s to another directory with the same files in native formats (WAV, GSM and U-Law) - see recipe Music-on-hold without MPG123 for an overview of how this works.FROMDIR="/root/mp3s"
TODIR="/root/transcodes"
for i in $FROMDIR/*.mp3
do
BASEFILE=$(basename $i .mp3)
echo Converting $BASEFILE
mpg123 -s --rate 44100 --mono $FROMDIR/$BASEFILE.mp3 > $TODIR/$BASEFILE.raw
sox -r 44100 -w -s -c 1 $TODIR/$BASEFILE.raw -r 8000 -c 1 $TODIR/$BASEFILE.wav
sox $TODIR/$BASEFILE.wav -t gsm -r 8000 -b -c 1 $TODIR/$BASEFILE.gsm
sox $TODIR/$BASEFILE.wav -t ul -r 8000 -b -c 1 $TODIR/$BASEFILE.pcm
rm -f $TODIR/$BASEFILE.raw
done
Softlinks:
Home Page - Music-on-hold without MPG123 - Installing the Asterisk GUI - Compiling Asterisk 1.4 beta - Installing QueueMetrics from scratch - Installing QueueMetrics - Utenti/Lenz73 - Converting sound files for Asterisk - Changing DTMF tone frequency in Asterisk - Configuring a queue - Create an account - Peering two Asterisk servers using IAX - Understanding queue logic - Removing Asterisk - Compiling Asterisk with OH323 - Improving AstRecipes - QueueMetrics - Misc links - AddQueueMember and the queue_log file - Upgrading QueueMetrics licences - Installing Queuemetrics on Debian - Add a recipe - Licences - Installing the Linksys PAP2-NA port adapter - asterisk - Avoiding queue_log file rotation - User stats - Checking library dependencies - Compiling Asterisk 1.2 with TDM400 and H323 - QueueMetrics logs - Listening to recorded calls using XC-AST - SandBox - Monitoring Zaptel Hardware - UPDATING - Simple queue and agent debug monitoring - Connecting to FWD using IAX - Creating XC-AST database - Quick and Dirty Asterisk sound recorder - Installing XC-AST - Administering QueueMetrics using Tomcat - Displaying OH323 calls - Turning off modules - Utenti/timlitw - Installing XC-AST under Jetty - Recording queue transfers to disk - Backup of an Asterisk system - Upgrading XC-AST licences - Utenti/peter-dean - Adding third-party modules to XC-AST - Utenti/lostdave
Home Page - Music-on-hold without MPG123 - Installing the Asterisk GUI - Compiling Asterisk 1.4 beta - Installing QueueMetrics from scratch - Installing QueueMetrics - Utenti/Lenz73 - Converting sound files for Asterisk - Changing DTMF tone frequency in Asterisk - Configuring a queue - Create an account - Peering two Asterisk servers using IAX - Understanding queue logic - Removing Asterisk - Compiling Asterisk with OH323 - Improving AstRecipes - QueueMetrics - Misc links - AddQueueMember and the queue_log file - Upgrading QueueMetrics licences - Installing Queuemetrics on Debian - Add a recipe - Licences - Installing the Linksys PAP2-NA port adapter - asterisk - Avoiding queue_log file rotation - User stats - Checking library dependencies - Compiling Asterisk 1.2 with TDM400 and H323 - QueueMetrics logs - Listening to recorded calls using XC-AST - SandBox - Monitoring Zaptel Hardware - UPDATING - Simple queue and agent debug monitoring - Connecting to FWD using IAX - Creating XC-AST database - Quick and Dirty Asterisk sound recorder - Installing XC-AST - Administering QueueMetrics using Tomcat - Displaying OH323 calls - Turning off modules - Utenti/timlitw - Installing XC-AST under Jetty - Recording queue transfers to disk - Backup of an Asterisk system - Upgrading XC-AST licences - Utenti/peter-dean - Adding third-party modules to XC-AST - Utenti/lostdave



