Click to See Complete Forum and Search --> : Stupid mp3 converting question (mpg123?)


Jomboni
01-24-2002, 10:49 PM
So I want to use mpg123 (or any other program you guys recommend) to convert all the .mp3 files in a directory to .wav files with the same filenames (just with a .wav extension). I did this a couple times before but now as I sit down to do it I can't for the life of me remember what I did!!! I checked the help, and there is no man page, and the info I found mentioned using the -w parameter, but I'm still lost. And I feel like an idjit.

sans-hubris
01-25-2002, 10:30 AM
-w should work. All you need is to specify the filename, e.g.:

mpg123 CoolBand.mp3 -w CoolBand.wav

I would suggest using mpg321 (http://mpg321.sourceforge.net/) as that's actually Free Software, where as mpg123 is not.

[ 25 January 2002: Message edited by: sans-hubris ]

Jomboni
01-25-2002, 05:21 PM
Yeah, I got that -w working just fine. The thing I can't do is convert all the songs in the folder. I have 12 mp3 files each with different filenames, and I want to convert them all to wav files without typing the whole filename each time.

I tried "mpg123 *.mp3 -w *.wav" but what this actually did was converted all the mp3s into ONE really really long wav file, named *.wav!

nuisance
01-25-2002, 07:58 PM
from the directory with the mp3s :


for i in *.mp3; do mpg321 -w `basename $i .mp3`.wav $i; done


or with lame :

for i in *.mp3; do lame --decode $i `basename $i .mp3`.wav; done

scanez
01-26-2002, 06:07 AM
For the csh/tcsh users, here's a script I wrote. This converts all mp3s in a directory given at the command line to wavs, and then moves them to my ~/music/wavs directory- change this to suit your needs. Also, if you have say foo.mp3, it will name it foo.mp3.wav

#!/bin/csh -f
## csh script: mkwavs
## converts all mp3s in directory given at command line to wavs
## and moves wavs to ~/music/wavs

set dir = $1

set x = `/bin/ls $dir`

foreach file($x)
mpg321 -w $file.wav $file
end

mv $dir/*.wav ~/music/wavs