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
 
LinkBack Search this Thread
Old 11-10-2005, 12:22 AM   #1
igimaster
LQ Newbie
 
Registered: Apr 2005
Posts: 27

Rep: Reputation: 15
wav to mp3 using wavr and lame


I'm currently running knoppix installed on a hard disk. I am planning on switching to full debian once I find a wav recording software as wavr does not come on 3.1 .
I'm am currently trying to use my linux box to record radio programs durring the day using a cable to connect the radio headphone jack to themicrophone port. I record the wav file using the command wavr -l 3600 -f filename
when I'm finished I run the script using a cron. the wav files are good sounding, but once I rip it to mp3 there's all sorts of extra interference in the background.
Is this because I'm using microphone jack. Any idea about what is causing this problem I want to be able to prevent it when I switch to a new program to go pure debian.

igimaster
 
Old 11-10-2005, 01:00 AM   #2
uberNUT69
Member
 
Registered: Jan 2005
Location: Tasmania
Distribution: Xen Debian Lenny/Sid
Posts: 578

Rep: Reputation: 30
My guess is that there are a few possibilities for poor sound in your setup:
1. Your encoding options are not set optimally
- could you provide the command line you are using to encode?
2. You need to use a better encoder.
3. The output level from your radio is incorrectly set (too high?)

I suggest you use audacity:
http://audacity.sourceforge.net/
to examine the waveform of both the wav and the mp3.
You should be able to find where errors are being introduced that way.
 
Old 11-10-2005, 01:21 AM   #3
Simon Bridge
Guru
 
Registered: Oct 2003
Location: Waiheke NZ
Distribution: Ubuntu 10.04
Posts: 9,196

Rep: Reputation: 190Reputation: 190
Anything which is due to the microphone will show up on the original wave recording. Your trouble will be from the wav-->mp3 encoding. This encoding is lossy (it has to be) so you will get some distortion no matter what.

To diagnose this you should really copy the script you use to this forum so we can see exactly what you are doing. However:

When encoding to mp3...
set the mono (-mo) flag and high quality (-h) flag. You should maybe use variable bitrate encoding of some sort too. (--vbr-old)

If the radio input is mono then it may only be recording to one channel, the other channel will be providing a "noisy" background - especially after encoding.

Higher quality uses better algorithms for encoding but is slower. Shouldn't bother you on a high speed machine and it seems you are doing the encoding (as a cronjob) in downtime anyway. This should have a marked improvment in recording quality.

VBR mainly reduces the chance of aliasing over fixed bitrate recordings. It may affect your recording quality.

Have you had a play with the lame options at all?

have you used lame to encode other wav files, besides the mic sourced ones? Of course, you could always start with high bitrate wave files...

Of course, normally sound from a microphone recorded at a high bitrate will be full of high frequency noise. However, this would be audible on the wav file playback as well as the mp3 one.

And, equally "of course", you wouldn't expect the phones-out jack on the radio to be well impedence-matched to the mic-in jack. You would expect some distortion in the recording unless you use an impedence-matching network. (These are very cheap to build, but require an oscilloscope to get right.)

Also, have you tried encoding to ogg format? The ogg algorithms are markedly better than the mp3 ones (which are basically fast-fourier transforms anyway) though the resulting file tends to be a little larger.
 
Old 11-10-2005, 08:36 PM   #4
igimaster
LQ Newbie
 
Registered: Apr 2005
Posts: 27

Original Poster
Rep: Reputation: 15
results

I have ripped cd's to mp3 before using abcde and did not get this kind of distortion.
I did have my sound too quite before. I turned it up so that it was almost hitting the max. recorded again using the following command
wavr -d 8 -c 1 -l 120 -s m -f /filename.wav
lame -m mo -h -vbr-old filename.wav filename.mp3

after running with the higher volume I got the same result as before a sort of hiccuping in the back ground that sounds like a pop. It's most noticeable with talkradio.
I am looking to remove the pop so I can listen to this in my car on an mp3 cdplayer. That's why I'm not using ogg.

If anyone has any further suggestions I'd appreciate response.

igimaster
 
Old 11-10-2005, 09:18 PM   #5
uberNUT69
Member
 
Registered: Jan 2005
Location: Tasmania
Distribution: Xen Debian Lenny/Sid
Posts: 578

Rep: Reputation: 30
If the popping was showing up in the wav I'd almost suspect an earth loop.
Try encoding a 'clean' wav from another source.
Have you observed the waveform in (eg) Audacity?
 
Old 11-10-2005, 09:30 PM   #6
igimaster
LQ Newbie
 
Registered: Apr 2005
Posts: 27

Original Poster
Rep: Reputation: 15
it was not in the wave file it was nothing like that it was just background noise in the wav the mp3 is where it shows up
igimaster
 
Old 11-10-2005, 10:18 PM   #7
uberNUT69
Member
 
Registered: Jan 2005
Location: Tasmania
Distribution: Xen Debian Lenny/Sid
Posts: 578

Rep: Reputation: 30
Perhaps the encoder is getting confused with white noise at a low quality/bitrate?
I note that you are not specifying bitrate or VBR quality setting.
You might want to increase these from default to see if the problem persists.

You may even be able to test that theory with http://freshmeat.net/projects/whitenoise/

Also, I'm running lame 3.96.1-1, and the manpage shows:
For WAV and AIFF input files, using -m -I m will always produce a mono .mp3 file from both mono and stereo input.

So I suggest you start with a simpler line and work up, adding bitrate and quality settings as you go:
eg:
lame -m -I m filename.wav filename.mp3
lame -m -I m -v -b 128 -B 160 filename.wav filename.mp3
...etc.

ps. double check your sampling frequency.
 
Old 11-11-2005, 11:22 AM   #8
igimaster
LQ Newbie
 
Registered: Apr 2005
Posts: 27

Original Poster
Rep: Reputation: 15
sucess

when i raised the sampling quality the conversion to mp3 finally worked.
Thanks for all the help somtimes I forget to try the simple stuff when I'm doing something new. Thanks for all the help.
igimaster
 
  


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
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
still need lame, etc to burn mp3 to cd? joel b Suse/Novell 1 05-04-2005 11:48 PM
ripping cds to mp3 (or wav to mp3) darkleaf Linux - Software 7 04-30-2005 07:23 AM
lame decoding to wav, entire /dir instead of one by one? mipia Linux - Software 6 04-19-2005 03:52 AM
Lame 3.96.1 killed when converting wav to mp3 sludink Linux - Software 0 01-14-2005 10:07 AM
Converting 8-bit wav to mp3 with Lame? lsakhvoruk Linux - Software 0 10-09-2002 05:12 PM


All times are GMT -5. The time now is 09:41 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
Open Source Consulting | Domain Registration