LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 01-28-2004, 02:12 PM   #1
andrewstr
Member
 
Registered: Oct 2003
Location: WA--USA
Distribution: Red Hat 9, Suse 10.2
Posts: 144

Rep: Reputation: 15
Question What is the minimum MP3 encoding rate?


I need to maintain a a backlog of a radio station's audio for a period of 90 days. Previously, I have been using RealProducer on a Windows machine. I got tired of the Windows machine crashing so I have upgraded the system to Red Hat 9 and am using SOX and LAME to encoder audio in real time to MP3. The encoding is working but I want to be able to use the highest compression rate available since quality is not that important.

I have tried encoding at a bit rate of 8k but when I play back the file, it plays very quickly. I have tried using several MP3 players but they all play the files too quickly. Here is the command I am using to do the encoding:

sox -r 8000 -t ossdsp -w -s /dev/dsp -t raw -c 2 - | lame -s 44.1 -x -b 8 -m m - sound.mp3


What do I need to do to record the smallest possible MP3 file?

Thank you!
 
Old 01-28-2004, 03:10 PM   #2
delta9
Member
 
Registered: Dec 2003
Distribution: Gentoo
Posts: 66

Rep: Reputation: 15
I'm not sure here but could it be that you are setting the audio samplerate to 8000 (instead of eg 44100 for cdquality) instead of the lame compression mp3 bitrate?

If you play a file with a samplerate of 8000Hz at the speed of a 44100Hz one it will play (more than 5 times) too fast.

Looking at the commandline you're using you are converting the input to a 8000Hz stream and recording it to a 44100Hz 8000bit/s mp3.

Last edited by delta9; 01-28-2004 at 03:13 PM.
 
Old 01-28-2004, 03:30 PM   #3
andrewstr
Member
 
Registered: Oct 2003
Location: WA--USA
Distribution: Red Hat 9, Suse 10.2
Posts: 144

Original Poster
Rep: Reputation: 15
I switched the command line to this:

sox -r 8000 -t ossdsp -w -s /dev/dsp -t raw -c 1 - | lame -s 8 -x -b 8 -m m - music.mp3&

Now the file plays at the correct rate but is completely unintelligible. I also get this error from mpg123:

mpg123: Can't rewind stream by 35 bits!

Any other ideas?
 
Old 01-28-2004, 05:11 PM   #4
delta9
Member
 
Registered: Dec 2003
Distribution: Gentoo
Posts: 66

Rep: Reputation: 15
Try a higher samplerate (11025, 22050) and/or bitrate (16kbit/s, 32kbit/s), and experiment with them, I think you can't go infinitely low with them and still have have something that sounds good.
 
Old 01-28-2004, 05:22 PM   #5
andrewstr
Member
 
Registered: Oct 2003
Location: WA--USA
Distribution: Red Hat 9, Suse 10.2
Posts: 144

Original Poster
Rep: Reputation: 15
I did a lot of experimenting and this seems to work OK:

sox -r 44100 -t ossdsp -w -s /dev/dsp -t raw -c 1 - | lame -s 44.1 -x -b 8 -m m --lowpass 5 -q 0 - music.mp3&

I really can't encode at a bit rate greater than 8 k because I would run out of space. With the settings above, the size of file is comparable to a RealAudio file at 8k but the RealAudio files sounds better IMHO. Do you have any experience with OGG files? I wonder if they would be better for audio archival purposes.
 
  


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
Encoding audio: Mp3 to Mp3 SolidSnakeX28 Linux - Software 7 06-25-2006 10:14 AM
Encoding mp3 with Suse 10 Jeffmrg SUSE / openSUSE 3 10-09-2005 01:55 PM
Ripping and encoding to MP3 mark_booze Linux - Newbie 6 12-28-2003 09:52 AM
MP3 Encoding - Please Help biggsjm Linux - Software 9 10-06-2003 02:52 PM
MP3 Encoding wonderpun Linux - Software 9 09-13-2002 07:00 AM

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

All times are GMT -5. The time now is 03:19 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