Review your favorite Linux distribution.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 10-17-2009, 05:12 PM   #1
Registered: Oct 2006
Distribution: Debian x64
Posts: 198

Rep: Reputation: 30
How to convert mp3 to raw data using the command line

I recently needed to convert mp3's to raw audio using the command line. There are many great links out there for how to do this; however, many of the command line options are deprecated and have been for a while. I liked this link.
The following currently works:
for i in $(ls *mp3); do ffmpeg -i $i "$i.wav"; done
for i in $(ls *wav); do sox -r 48k  -b 16 -L -c 1 $i $i.raw; done
Before burning you can check the sound with:
play -r 48k -s -b 32 -L -c 1 somefile.raw
Old 10-17-2009, 05:29 PM   #2
Registered: Oct 2006
Distribution: Debian x64
Posts: 198

Original Poster
Rep: Reputation: 30
Using the playback code above things work fine. However, when trying to play as a CD the sound is distorted and atrocious. What are the specifications to convert a wav to a suitable raw file for a CD? This thread looked promising but didn't work for me.

Last edited by donnied; 10-17-2009 at 06:23 PM.


ffmpeg, howto, mp3, raw, sox, wav

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 Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
client server raw socket without using command line argument edens_2001 Linux - Networking 1 03-13-2007 07:14 AM
How do I convert to an Integer with the Command Line? falcon56215 Linux - Software 10 02-17-2007 01:58 PM
cmd line prog to convert mp3 samplerate kmasaryk Linux - Desktop 4 11-25-2006 12:05 AM
recording raw binary data as an MP3 uman Linux - General 1 02-19-2005 09:07 PM
mp3 batch convert, remote from command line zerodot Linux - Networking 1 02-12-2003 05:08 AM

All times are GMT -5. The time now is 02:44 PM.

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