Skip to main content

Thread: scripting to convert .wav to .mp3 files


i have set of 5 files:
tell-all -- disc 1.wav
tell-all -- disc 2.wav
tell-all -- disc 3.wav
tell-all -- disc 4.wav
tell-all -- disc 5.wav

on need perform following actions:
mp3sencoder -if "tell-all -- disc 1.wav" -of "tell-all -- disc 1.mp3" -br 24000 -mono
mp3sencoder -if "tell-all -- disc 2.wav" -of "tell-all -- disc 2.mp3" -br 24000 -mono
mp3sencoder -if "tell-all -- disc 3.wav" -of "tell-all -- disc 3.mp3" -br 24000 -mono
mp3sencoder -if "tell-all -- disc 4.wav" -of "tell-all -- disc 4.mp3" -br 24000 -mono
mp3sencoder -if "tell-all -- disc 5.wav" -of "tell-all -- disc 5.mp3" -br 24000 -mono

have other files in future need convert .wav .mp3.

how go automating automatically take every .wav in directory , convert mp3sencoder .mp3 options of -br 24000 -mono while retaining filename?

code:
while [ $# -ge 1 ];     filename=`echo "$1" | sed 'y/abcdefghijklmnopqrstuvwxyz/abcdefghijklmnopqrstuvwxyz/'`     case "$filename" in         *.wav)            mp3sencoder -if "$1" -of "$1".mp3 -br 24000 -mono             ;;         *)             echo "not doing anything"             exit 0             ;;     esac     shift done
this file can drag files on, , automatically convert every file.

i'm not sure if "$1".mp3 part work. try first

ps: make file called "blablabla.wav.mp3"


Forum The Ubuntu Forum Community Ubuntu Official Flavours Support General Help [SOLVED] scripting to convert .wav to .mp3 files


Ubuntu

Comments

Popular posts from this blog

How to change text Component easybook reloaded *newbee* - Joomla! Forum - community, help and support

After Effect warning: A problem occurred when processing OpenGL commands

Preconditions Failed. - Joomla! Forum - community, help and support