LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 05-17-2006, 04:10 AM   #1
arubin
Senior Member
 
Registered: Mar 2004
Location: Middx UK
Distribution: Slackware64 15.0 (multilib)
Posts: 1,350

Rep: Reputation: 75
Documentation for Sox ?


I am looking for instructions on how to use Sox. I haven't found anything through Googling and the sourceforge page is not very instructive.

I also want to convert mp2 to mp3. Am I corrct in thinking that
sox input.mp2 output.mp3 will do the job.

Tha nks.
 
Old 05-17-2006, 11:47 PM   #2
macemoneta
Senior Member
 
Registered: Jan 2005
Location: Manalapan, NJ
Distribution: Fedora x86 and x86_64, Debian PPC and ARM, Android
Posts: 4,593
Blog Entries: 2

Rep: Reputation: 344Reputation: 344Reputation: 344Reputation: 344
The man page (man sox) has the documentation and examples. The command you listed will work, but you may want to tune the parameters a bit.
 
Old 05-18-2006, 12:37 AM   #3
Linux~Powered
Member
 
Registered: Jan 2004
Location: /lost+found
Distribution: Slackware 14.2
Posts: 849

Rep: Reputation: 33
How about something like...

for file in *.mp2; do
echo "Converting $file to "$(basename "$file" .mp2).mp3""
sox -t mp2 "$file" -t mp3 -w -s -c 2 "$(basename "$file" .mp2).mp3"
done

Something like that anyways. I'm not a very good programmer so it might need tweaked.
 
Old 05-18-2006, 01:04 PM   #4
arubin
Senior Member
 
Registered: Mar 2004
Location: Middx UK
Distribution: Slackware64 15.0 (multilib)
Posts: 1,350

Original Poster
Rep: Reputation: 75
alan@LavanKossot:~/documents/radio$ sox 05171100.mp2 05171100.mp3
sox: Failed reading 05171100.mp2: Do not understand format type: mp2

alan@LavanKossot:~/documents/radio$ sox -t mp2 "05171100.mp2" -w -s -c2 "0517110.mp3"
sox: Unknown input file format for '05171100.mp2': File type 'mp2' is not known
 
Old 05-18-2006, 01:16 PM   #5
macemoneta
Senior Member
 
Registered: Jan 2005
Location: Manalapan, NJ
Distribution: Fedora x86 and x86_64, Debian PPC and ARM, Android
Posts: 4,593
Blog Entries: 2

Rep: Reputation: 344Reputation: 344Reputation: 344Reputation: 344
A type of mp2 doesn't mean anything (see: man sox). For example, mp3 is just a shorthand for mpeg2 layer 3. If the audio was taken from a DVD, it may be a type of raw file, since it doesn't have any recognizable header. If you don't know how the audio was extracted, you'll need to experiment some.
 
Old 05-19-2006, 05:06 AM   #6
arubin
Senior Member
 
Registered: Mar 2004
Location: Middx UK
Distribution: Slackware64 15.0 (multilib)
Posts: 1,350

Original Poster
Rep: Reputation: 75
The audio files are produced by a digital radio, Evoke 3 (see www.pure.com) which can record radio programs onto an SD chip but only save them as mp2 files. According to the instruction manual "EVOKE-3 records DAB radio to SD cards in MP2 format. You may need a computer to convert these files to a different format if you wish to use them in another device"

I want to listen to these files on my mp3 player. I have tried copying them over but the device does not even seem to see them. I can load them using audacity and export them as MP3 files but this is a bit tedious and I was hoping to do something from the command line.

The manufacturer at
http://pure.com/support/kb.asp?Refer...0767#Reference
recommends a shareware Windows program called Easy CD-DA Extractor

Last edited by arubin; 05-19-2006 at 11:44 AM.
 
Old 05-19-2006, 11:45 AM   #7
macemoneta
Senior Member
 
Registered: Jan 2005
Location: Manalapan, NJ
Distribution: Fedora x86 and x86_64, Debian PPC and ARM, Android
Posts: 4,593
Blog Entries: 2

Rep: Reputation: 344Reputation: 344Reputation: 344Reputation: 344
OK, it looks like sox is the wrong tool for this. You will need to use lame:

lame sample.mp2 sample.mp3

Lame specifically handles mpeg layer 2 input files.
 
Old 05-19-2006, 11:45 AM   #8
arubin
Senior Member
 
Registered: Mar 2004
Location: Middx UK
Distribution: Slackware64 15.0 (multilib)
Posts: 1,350

Original Poster
Rep: Reputation: 75
Smile

I have discovered that the conversion can be dome with lame
lame --mp2input 05171100.mp2 05171100.mp3
 
Old 01-12-2007, 07:08 AM   #9
c_malc
LQ Newbie
 
Registered: Jan 2005
Posts: 3

Rep: Reputation: 0
ffmpeg works for me:

ffmpeg -i filename.mp2 -ar 48000 -ab 128 -ac 2 -acodec mp3 newfilename.mp3
 
  


Reply



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
SoX karunesh General 1 08-09-2005 01:07 PM
Cannot install Sox! Sebastian Naitsabes Linux - Software 7 07-14-2005 12:31 PM
The Sox Parade H2O-linux General 4 11-01-2004 08:48 PM
WARN: sox Joey.Dale Linux - Security 1 08-11-2004 06:02 AM
SOX - Save Our X benjaminrtz Linux - General 6 09-01-2002 10:45 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 09:10 PM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration