Skip to main content

Topic: Noisy result when compressing raw to mp3 with lame (Read 4578 times) previous topic - next topic

0 Members and 1 Guest are viewing this topic.
  • gabriel86
  • [*]
Noisy result when compressing raw to mp3 with lame
Hello everyone,

I've been trying to compress a raw file with lame encoder to mp3. The resulting file plays out some of the original sound but covered in a lot of noise.
I also imported the file into audacity using import raw, and exported as an mp3 through lame and got a clean result - no noise.

The raw and mp3 files can be found here.

While importing to audacity i use the following settings :

32 bit float
Big-endian
1 Channel (Mono)
Start Offset 0 bytes
Amount to import 100%
Sample rate 44100 Hz

The command for lame command line is

lame -m m -r --bitwidth 32 123.raw --big-endian 123.mp3

If this topic has already been discussed, i apologize for the incorrect post and please direct me to it.

Best regards,
Gabriel

  • Maggi
  • [*][*][*]
Noisy result when compressing raw to mp3 with lame
Reply #1
uhm, I think MP3 is limited to 16bit samples and it seems you are trying to compress 32bit audio data

no surprise to me that you get an MP3 of noise

try with bitwidth of 16 and you should be fine


Cheers,
Maggi


update:

I just listened to your 32bit raw file and it sounds horrible on my speakers, maybe because of those fairly loud high frequency portions.

However, even after exporting it to 16bit WAV and the compressing to mp3, it still sounds awefull, but both files sound similar to the raw file and are not as heavily compressed and distorted as your mp3 file

to sum it up, I don't know what's going wrong

Sorry
  • Last Edit: 03 July, 2009, 09:45:21 AM by Maggi

  • gabriel86
  • [*]
Noisy result when compressing raw to mp3 with lame
Reply #2
uhm, I think MP3 is limited to 16bit samples and it seems you are trying to compress 32bit audio data

no surprise to me that you get an MP3 of noise

try with bitwidth of 16 and you should be fine


Cheers,
Maggi


update:

I just listened to your 32bit raw file and it sounds horrible on my speakers, maybe because of those fairly loud high frequency portions.

However, even after exporting it to 16bit WAV and the compressing to mp3, it still sounds awefull, but both files sound similar to the raw file and are not as heavily compressed and distorted as your mp3 file

to sum it up, I don't know what's going wrong

Sorry
Hi,

I'm using lame encoder on linux could that be a problem.
Should i use a diffrent encoder?

Regards,
Gabriel

  • lvqcl
  • [*][*][*][*][*]
  • Developer
Noisy result when compressing raw to mp3 with lame
Reply #3
Quote
lame -m m -r --bitwidth 32 123.raw --big-endian 123.mp3


I think LAME treats input as 32-bit int, not 32-bit float. Convert your raw file from float type to integer and try to encode.
  • Last Edit: 03 July, 2009, 10:29:00 AM by lvqcl

  • gabriel86
  • [*]
Noisy result when compressing raw to mp3 with lame
Reply #4
Quote
lame -m m -r --bitwidth 32 123.raw --big-endian 123.mp3


I think LAME treats input as 32-bit int, not 32-bit float. Convert your raw file from float type to integer and try to encode.


Hi,

That's exactly what i tried after the last post and it worked. The ideea came to me from another post on this forum.
Thank you guys, you're life savers.     

Regards,
Gabriel

  • andy09
  • [*]
Noisy result when compressing raw to mp3 with lame
Reply #5
Quote
I think LAME treats input as 32-bit int, not 32-bit float. Convert your raw file from float type to integer and try to encode.


I'm having the same problem with just noise as result - how do I convert the raw file from float to int?


  • andy09
  • [*]
Noisy result when compressing raw to mp3 with lame
Reply #6
Solved.
I added -x as an lame option and the noise was turned into sound.