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 - Converting sound files for Asterisk - Configuring a queue - Understanding queue logic - Utenti/Lenz73 - Changing DTMF tone frequency in Asterisk - Installing QueueMetrics - Peering two Asterisk servers using IAX - Create an account - Compiling Asterisk with OH323 - Improving AstRecipes - Simple queue and agent debug monitoring - Removing Asterisk - Misc links - Installing the Linksys PAP2-NA port adapter - Installing Queuemetrics on Debian - QueueMetrics - Compiling Asterisk 1.2 with TDM400 and H323 - Upgrading QueueMetrics licences - Licences - Checking library dependencies - Add a recipe - asterisk - Monitoring Zaptel Hardware - AddQueueMember and the queue_log file - User stats - Avoiding queue_log file rotation - QueueMetrics logs - Listening to recorded calls using XC-AST - Creating XC-AST database - Connecting to FWD using IAX - Quick and Dirty Asterisk sound recorder - Backup of an Asterisk system - Upgrading XC-AST licences - Displaying OH323 calls - Administering QueueMetrics using Tomcat - Recording queue transfers to disk - Turning off modules - UPDATING - SandBox - Utenti/timlitw - Installing XC-AST - Utenti/lostdave - Utenti/peter-dean - Installing XC-AST under Jetty - Adding third-party modules to XC-AST
Home Page - Music-on-hold without MPG123 - Installing the Asterisk GUI - Compiling Asterisk 1.4 beta - Installing QueueMetrics from scratch - Converting sound files for Asterisk - Configuring a queue - Understanding queue logic - Utenti/Lenz73 - Changing DTMF tone frequency in Asterisk - Installing QueueMetrics - Peering two Asterisk servers using IAX - Create an account - Compiling Asterisk with OH323 - Improving AstRecipes - Simple queue and agent debug monitoring - Removing Asterisk - Misc links - Installing the Linksys PAP2-NA port adapter - Installing Queuemetrics on Debian - QueueMetrics - Compiling Asterisk 1.2 with TDM400 and H323 - Upgrading QueueMetrics licences - Licences - Checking library dependencies - Add a recipe - asterisk - Monitoring Zaptel Hardware - AddQueueMember and the queue_log file - User stats - Avoiding queue_log file rotation - QueueMetrics logs - Listening to recorded calls using XC-AST - Creating XC-AST database - Connecting to FWD using IAX - Quick and Dirty Asterisk sound recorder - Backup of an Asterisk system - Upgrading XC-AST licences - Displaying OH323 calls - Administering QueueMetrics using Tomcat - Recording queue transfers to disk - Turning off modules - UPDATING - SandBox - Utenti/timlitw - Installing XC-AST - Utenti/lostdave - Utenti/peter-dean - Installing XC-AST under Jetty - Adding third-party modules to XC-AST



