Find the answer to your Linux question:
Results 1 to 3 of 3
Hi. The command that I am using is: mpg321 -b 10000 -s songname.mp3 | sox -t wav -r 44100 -s -w -c 2 - songname.wav mpg321 seems to create the ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined! adamdaughterson's Avatar
    Join Date
    Mar 2003
    Location
    Denver, Colorado, USA
    Posts
    78

    mpg321 doesn't convert mp3 to wav properly


    Hi. The command that I am using is:

    mpg321 -b 10000 -s songname.mp3 | sox -t wav -r 44100 -s -w -c 2 - songname.wav

    mpg321 seems to create the file, but it is not creating the RIFF header properly. The error output is "sox failed reading -: WAVE: RIFF header not found.
    Also when I try to open the file using any multimedia app (XMMS, grecord, etc...) the errors are the same. Is there something I am missing? There don't seem to be a great deal of references on Google about mpg321, does anyone know where there might be good examples of it working to perform mp3 to wav conversion?
    cheers,
    Adam D.[/i]

  2. #2
    Linux Guru
    Join Date
    Oct 2001
    Location
    Täby, Sweden
    Posts
    7,578
    Everything is as it should. The thing is that mpg123 doesn't create WAV files; it creates raw files (ie. no header at all). Also, no buffering is necessary when just converting, so just run this instead: "mpg123 -s song.mp3 | sox -t .raw -r 44100 -sw -c 2 - output.wav".
    (Hint: mpg321 is aliased to mpg123, and mpg123 is more common, since it's the name of the original application. You might have known that, I just mentioned it in case you didn't.)

  3. #3
    Just Joined! adamdaughterson's Avatar
    Join Date
    Mar 2003
    Location
    Denver, Colorado, USA
    Posts
    78

    Thanks

    Ahh... I see. I was trying to pass a *.wav to sox, but it was just the datastream. That makes sense now. Thank you for you tip!
    Adam

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •