Programmer » Audio Conversion

Audio Conversion

There are high-quality free windows utilities to convert between different audio formats -- wma, wav, mp3, rm. I have links to them on this page. Also on this page I have some very simple batch files which convert all files in the current directory.

For each of the following batch files, I'd save the batch file in c:\windows for convenience, so it's on the path.

mp3-to-wav - download mp32wav.bat

Convert mp3 to wav. Requires lame.

for %%I in (*.mp3) do lame --decode "%%I" "%%~nI.wav"

mp3-to-wma - mp32wma.bat

Convert wmp3 to wma. Requires Windows Media Encoder.

for %%I in (*.mp3) do cscript.exe "\program files\windows media components\encoder\wmcmd.vbs" -input "%%I" -output "%%~nI.wma" -profile a128

rm-to-wav - rm2wav.bat

Convert rm realaudio to wav. Requires mplayer and codecs. Will screw up output filenames if they had commas in them.

for %%I in ("*.rm" "*.ram" "*.ra") do mplayer "%%I" -ao pcm:fast:file="%%~nI.wav" -vc null -vo null

Download a .rm file from a realaudio stream. Requires mplayer and codecs. A web-page with a button to stream realaudio will usually have a shortcut to a ".rm" or ".ram" file somewhere. Download this file onto your hard disk and examine in in notepad. It will usually have a link to the actual stream, in the form "rtsp://".

mplayer "rtsp://" -dumpstream -dumpfile download.rm -bandwidth 99999999

wav-to-mp3 - wav2mp3.bat, radio2mp3.bat

Convert wav to mp3. Requires lame

for %%I in (*.wav) do lame --preset extreme --priority 0 "%%I" "%%~nI.mp3"
// radio2mp3.bat: for converting wav into highly-compressed mp3
for %%I in (*.wav) do lame -h -V9 --priority 0 "%%I" "%%~nI.mp3"

wma-to-wav - wma2wav.bat, wma2wav1.bat

Convert wma to wav. Requires mplayer.

// This goes in the file wma2wav.bat:
for %%I in (*.wma) do call c:\windows\wma2wav1.bat "%%I" "%%~nI.wav"

// This goes in the file wma2wav1.bat:
mplayer %1 -ao pcm:fast:file="temp.wav" -vc null -vo null
ren temp.wav %2

Here I'm putting the output of mplayer into "temp.wav" before renaming it to the real filename. This gets around the problem that mplayer screws up filenames with commas in them.

Thanks for the scripts, they look like an easy solution while other (commercial) programs are way more complicated. I'm using the mp32wma script. Unfortunately the IDtags disappear after the conversion. Is there a way to keep them without re-entering them one by one?
Thanks for the scripts. I mainly needed a solution to convert a ton of WAV files I have backed up to .mp3 so I could put them on my mp3 player. The batch file worked perfect!!
add comment  edit commentPlease add comments here