Converting mp3 to wav

Top Page
Attachments:
Message as email
+ (text/plain)
Delete this message
Reply to this message
Author: der.hans
Date:  
Subject: Converting mp3 to wav
Am 30. Jan, 2002 schwätzte Hunter Kreie so:

> I had the same concern. At first I thought "What about filenames containing
> spaces? Each element will be treated as a different file." Correct me if I
> am wrong, but I'm pretty sure the script Douglas wrote takes care of this.
>
> >#!/bin/sh
> >#
> >ls *.mp3 | while read i
> >    do
> >        o=$(echo "$i" | sed -e "s/mp3/wav/")
> >        mpg123 -b 10000 -s "$i" | sox -t raw -r 44100 -s -w -c2 - "$o"
> >    done
> >## eof

>
> This pipes each line, rather than each element, of the output of ls to the
> read command in the while. So if we had ./Bullet With Butterfly Wings -
> Smashing Pumpkins.mp3, i="Bullet With Butterfly Wings - Smashing
> Pumpkins.mp3" in the first iteration, rather than just "Bullet".


Technically, you're correct. The proper answer, however, is "Spaces in file
names are evil and unnatural. They should be banned and you should simply
removed them from any filesystem where they are encountered!" :).

rm -rf /home/lufthans/tmp/mnt/dows/c:/Program\ Files/ # ;-)

ciao,

der.hans
--
# http://home.pages.de/~lufthans/ http://www.DevelopOnline.com/
# If you're not learning, you're not living. - der.hans