voip:create_moh_files
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| voip:create_moh_files [2013/11/28 13:00] – biggi | voip:create_moh_files [2015/08/15 22:56] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | Quick script to convert .mp3 files to .wav | + | Quick script |
| + | |||
| + | Example: " | ||
| + | 8000_ArtistGuy_-_SongTitle.wav\\ | ||
| + | 16000_ArtistGuy_-_SongTitle.wav\\ | ||
| + | 32000_ArtistGuy_-_SongTitle.wav\\ | ||
| + | 48000_ArtistGuy_-_SongTitle.wav\\ | ||
| + | |||
| + | So, HZ is added and space is converted to underscore. | ||
| <code - convertsongs.sh> | <code - convertsongs.sh> | ||
| #!/bin/bash | #!/bin/bash | ||
| IFSORG=$IFS | IFSORG=$IFS | ||
| + | BITRATES=" | ||
| IFS=$' | IFS=$' | ||
| for x in `ls *.mp3`; do | for x in `ls *.mp3`; do | ||
| Line 9: | Line 18: | ||
| SONGNAME=`echo $x | tr " " _ | sed ' | SONGNAME=`echo $x | tr " " _ | sed ' | ||
| - | # Now convert 'em songs son! | + | # Now convert 'em songs! |
| echo " | echo " | ||
| - | echo "8000 HZ.."; | + | IFS=$IFSORG; |
| - | mpg123 -q -s -f 8192 --mono -r 8000 -w "8000_$SONGNAME" | + | for y in $BITRATES; do |
| - | echo "16000 HZ.."; | + | echo -n "$y Hz.. "; |
| - | mpg123 | + | mpg123 -q -s -f 8192 --mono -r $y -w "${y}_$SONGNAME" |
| - | echo "32000 HZ.."; | + | done |
| - | mpg123 -q -s -f 8192 --mono -r 32000 -w "32000_$SONGNAME" | + | echo ""; |
| - | echo "48000 HZ.."; | + | IFS=$' |
| - | mpg123 -q -s -f 8192 --mono -r 48000 -w " | + | |
| done | done | ||
| IFS=$IFSORG | IFS=$IFSORG | ||
voip/create_moh_files.1385640012.txt.gz · Last modified: (external edit)
