LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
LinkBack Search this Thread
Old 04-19-2002, 12:25 AM   #1
l_9_l
Member
 
Registered: Dec 2001
Location: New Zealand,Auckland
Distribution: debian
Posts: 86

Rep: Reputation: 15
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
 
Old 04-19-2002, 02:01 AM   #2
Rex_chaos
Member
 
Registered: Aug 2001
Location: GD, GZ, China
Posts: 240

Rep: Reputation: 30
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
 
Old 04-19-2002, 02:44 AM   #3
l_9_l
Member
 
Registered: Dec 2001
Location: New Zealand,Auckland
Distribution: debian
Posts: 86

Original Poster
Rep: Reputation: 15
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

Last edited by l_9_l; 04-20-2002 at 03:29 AM.
 
Old 04-19-2002, 03:00 AM   #4
Rex_chaos
Member
 
Registered: Aug 2001
Location: GD, GZ, China
Posts: 240

Rep: Reputation: 30
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.
 
Old 04-19-2002, 03:20 AM   #5
l_9_l
Member
 
Registered: Dec 2001
Location: New Zealand,Auckland
Distribution: debian
Posts: 86

Original Poster
Rep: Reputation: 15
The same
This is the error:

doc: No such file or directory

I run the script in the folder which has the mp3 files.

Last edited by l_9_l; 04-19-2002 at 03:22 AM.
 
Old 04-19-2002, 03:26 AM   #6
Rex_chaos
Member
 
Registered: Aug 2001
Location: GD, GZ, China
Posts: 240

Rep: Reputation: 30
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
 
Old 04-19-2002, 04:54 AM   #7
l_9_l
Member
 
Registered: Dec 2001
Location: New Zealand,Auckland
Distribution: debian
Posts: 86

Original Poster
Rep: Reputation: 15
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
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
I need help to solve this problem TheTiger Fedora 1 10-26-2005 01:01 PM
Who can help me to solve this problem? Annie0716 Programming 2 08-09-2004 07:59 PM
I don't know how to solve a problem in C nostrum Programming 5 07-20-2004 07:57 AM
No one can solve my problem Sundance Linux - Newbie 5 12-08-2003 01:13 PM
The only problem I couldn't solve... Bager Linux - Laptop and Netbook 2 07-21-2003 08:37 AM


All times are GMT -5. The time now is 01:35 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration