any smart way to solve this problem?
Hi Everyone..
I'm looking for smart way to convert *.mp3 to *.wav provided that the files have the same name,e.g. linux.mp3 (as an input) linux.wav (as an output) when I use : >mpg123 --wav - *.mp3 > *.wav the outputs will be one file (its name *.wav) is there any smarter way than >mpg123 --wav - *.mp3 > 1.wav 2.wav 3.wav etc.. -Note: *.mp3 = hundreds of files and haven't sorted names like 1.mp3 2.mp3 or a.mp3 or b.mp3..etc |
I don't know the usage of mpg123. However, if I understand the
question completely, the following shell script does help. # # for doc in *.mp3 do filename=${doc/.mp3/""} mpg123 --wav - doc > "$filename.wav" done |
unfortunately,doesn't work! :(
There's semilar problem too: I've downloaded many of the slackware packages through "httrack" which extracted them while the downloading(I didn't use to know that it does so!) Now,I want to install one of those packages I get this error message from "installpkg": Cannot install kift.tgz: package is corrupt (failed 'gzip -l kift.tgz') I tried to compress them via "gzip" and encouter this error message from "gzip": gzip: kift.tgz already has .tgz suffix -- unchanged there're terrible solutions,but I'm looking for the smart and skilled solutions that Linux offers them. anyway,thanks Rex_chaos |
I wonder if mpg123 is a time-consuming process. If so, try to add 'wait' after mpg123.
I didn't verify it, I hope it works. |
The same :(
This is the error: doc: No such file or directory I run the script in the folder which has the mp3 files. |
I am sorry. I make some mistake. The script should be
# # for doc in *.mp3 do filename=${doc/.mp3/""} mpg123 --wav - $doc > "$filename.wav" wait done I succeed in transforming *.mp3 into *.wav with the above script Good luck |
finally
Yes it works properly now..Thanks Rox
I've got another solution too from Howto-MINI-MP3-CD-Burning: for i in *.mp3; do mpg123 -w `basename $i .mp3`.wav $i; done All the ways led to ROME |
All times are GMT -5. The time now is 03:12 PM. |