Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: 24bit files and LAME (Read 10190 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

24bit files and LAME

Hello all,
this is my first time psoting...

i have searched all over the web for a way to use 24bit files with LAME.

this is what happens...  i have 24bit 48khz audio files.  when i try to encode them with LAME, i get white noise as the output file.  i have downloaded a few other encoders that use LAME, and some do the same as what i described, while some do not.

what i would like is to use 24bit files as input and have LAME make 16bit mp3's.

so if anyone knows how i can configure LAME to do this that would be great.  i assume the easy way is to truncate the 24bit file to 16bits before encoding...  can LAME do that ??

any help is greatly appreciated!
shake

p.s.  this is for a simple drag-and-drop GUI front end for LAME on OSX (maybe windows too).

24bit files and LAME

Reply #1
LAME can read 24 bit WAV files. Are you sure yours is WAV?
If it is raw format, you will have to give LAME more informations --> see lame --longhelp

24bit files and LAME

Reply #2
just want to add to that...

i tried using the --bitwidth option in LAME...  doesnt seem to work.
i tried this:  /lame --bitwidth 24 file.aif file.mp3

also, LAME says that the input file isnt 16bits...
i thought LAME was supposed to support 8, 16, 24 and 32 bit files ???

help !!

24bit files and LAME

Reply #3
Oh, I forgot: Welcome to Hydrogenaudio!

I don't know about the MAC version, but the windows LAME can only read raw and wav data. Can you somehow save your aif as wav?

24bit files and LAME

Reply #4
iirc, it does... i think the problem is the decoder

[edit: omg everyone respond at once]

24bit files and LAME

Reply #5
You could use wavewizard as a sort of frontend.  When i use it to convert 24bit wav to mp3 it works perfect. You can find it using google.

Wavewizard will rewrite the wav so lame can handle it for sure.  So if somehow the file is not correctly recognized, ww will fix it.

24bit files and LAME

Reply #6
Lame supports 24bits with wav and raw input. However, your file is an aiff file, not a wav file.
I have no idea if Lame supports 24bits aiff files...

24bit files and LAME

Reply #7
thanks for all the replies.

i tried a 24bit wav file...  and that worked without incident.

however, wokring at a recording studio, everyone in our professional circle uses aiff's.  so we always mix-down to 24bit aiff first, and then encode to mp3 or downsampl to 16bit 44.1khz etc...  why no 24bit aiff support in LAME?  aiff is not some weird outdated format.

and, as far as i know, the MAC and windows versions of LAME are the same.  its just compiled for a different processor.

24bit files and LAME

Reply #8
k... i found an app called libsndfile that converts aif to wave which in turn goes into LAME and it works perfectly.

why doesnt lame support aiff 24bit?  maybe in version 4?

24bit files and LAME

Reply #9
sndfile-convert (included with libsndfile) will convert aiff to pcm/wav.

i can't get any aif file to work with lame... weird

24bit files and LAME

Reply #10
iirc, you need a lame version which is linked against libsndfile.

24bit files and LAME

Reply #11
ah, right, i changed from libsndfile to lame IO because libsndfile didn't accept stdin.

so... should this be added to libsndfile? lame NEEDS stdin

clearly both are needed (and equally important, it seems)


later

24bit files and LAME

Reply #12
What is the (theoretical?) limit on bit depth in MP3?

24bit files and LAME

Reply #13
Quote
have LAME make 16bit mp3's.[a href="index.php?act=findpost&pid=334145"][{POST_SNAPBACK}][/a]


MP3s don't have a bit-depth.

24bit files and LAME

Reply #14
The reason is that they work with floating-point values. Bitdepth is used for integer values.

24bit files and LAME

Reply #15
Quote
What is the (theoretical?) limit on bit depth in MP3?
[a href="index.php?act=findpost&pid=334417"][{POST_SNAPBACK}][/a]


I believe the bitdepth isn't set until after decode, so you could output at any bitdepth you like.  Obviously ouputing at higher then 24 bit would be fairly useless, but the internal precision is at least SP floating point, so the decoder has the precision at least.

24bit files and LAME

Reply #16
Thanks for the reply!

So there's no 'completely accurate' decoder for MP3? Is this the case with all lossy formats?

24bit files and LAME

Reply #17
Quote
thanks for all the replies.

i tried a 24bit wav file...  and that worked without incident.

however, wokring at a recording studio, everyone in our professional circle uses aiff's.   so we always mix-down to 24bit aiff first, and then encode to mp3 or downsampl to 16bit 44.1khz etc...   why no 24bit aiff support in LAME?  aiff is not some weird outdated format.[a href="index.php?act=findpost&pid=334173"][{POST_SNAPBACK}][/a]
It is a weird format on PC's.

24bit files and LAME

Reply #18
Quote
So there's no 'completely accurate' decoder for MP3? Is this the case with all lossy formats?[a href="index.php?act=findpost&pid=334442"][{POST_SNAPBACK}][/a]

This is an interesting question. Naturally the decoded result is not accurate when compared with the original source, but is there always one hard-coded correct way to decode an mp3 file? Previously I have read that not all SW decoders are the same. Some are better than others, but just now I don't recall how the decoders are supposed to be different.

Is a quality-wise correct decoder possible only in theory and are the software decoders only trying to achieve the best possible result within the given limits like decoding time?

Also, I have read several hardware device reviews (stand-alone DVD players etc) where the traditional audio measurements of the decoded output have been more or less inferior to what they are when the source is Audio CD. I mean things like having a straight frequency response curve etc.

24bit files and LAME

Reply #19
Quote
Previously I have read that not all SW decoders are the same. Some are better than others, but just now I don't recall how the decoders are supposed to be different.

Decoders are supposed to give very similar output. ISO defines accuracy level for a decoder to be conformant. So the distinction is that some are correct, and some are not.

Sometimes decoders can also include some "post processing" for the floating/fixed point to integer conversion (ie dithering).

Quote
Also, I have read several hardware device reviews (stand-alone DVD players etc) where the traditional audio measurements of the decoded output have been more or less inferior to what they are when the source is Audio CD. I mean things like having a straight frequency response curve etc.

This is because there is an encoder before the decoder. Traditionnal measurements are meaningless in the context of perceptual encoders.

24bit files and LAME

Reply #20
Quote
This is because there is an encoder before the decoder. Traditionnal measurements are meaningless in the context of perceptual encoders.[a href="index.php?act=findpost&pid=335902"][{POST_SNAPBACK}][/a]

Actually, I meant a bit different thing. I suppose I understand the difference you mentioned. However, I have believed that e.g. the frequency response curve of a SW decoded properly made LAME mp3 file (like -V2 and above) is quite accurate and straight below the lowpass point when it is measured using traditional methods like test tones at high enough volume levels. Otherwise the perceived transparency would not be possible at the current extent.

I have understood that sometimes the decoders in otherwise high quality devices have been measured to be inferior when the internal decoder has been compared with a software-decoded file. In other words: some stand-alone CD/DVD/MP3 players can produce better test results when an Audio CD burned from a SW decoded MP3 test file is used instead of decoding the same mp3 file directly by the device.

 

24bit files and LAME

Reply #21
Quote
However, I have believed that e.g. the frequency response curve of a SW decoded properly made LAME mp3 file (like -V2 and above) is quite accurate and straight below the lowpass point when it is measured using traditional methods like test tones at high enough volume levels. Otherwise the perceived transparency would not be possible at the current extent.

No, such methods do not work or do not produce reliable results.

Quote
I have understood that sometimes the decoders in otherwise high quality devices have been measured to be inferior when the internal decoder has been compared with a software-decoded file.

The decoder is compliant or it is not. It HAS TO produce a correct result. There is no "nearly correct" result.

24bit files and LAME

Reply #22
Really? then how come I've seen posts which recommend MAD etc for highest quality decoding? ie: ("Because MAD provides full 24-bit PCM output, applications using MAD are able to produce exceptionally high quality audio. Even when the output device supports only 16-bit PCM, applications can use the extra resolution to increase the audible dynamic range through the use of dithering or noise shaping.") http://www.underbit.com/products/mad/

I fully understand what you're saying, I mean you don't see people saying one JPEG decoding library produces better output than another, but every decoder is not bit-for-bit identical to another is it?

BTW I think .wav and .aiff are the same thing, except aiff is big-endian and has a different header. They're both just PCM anyway - i bet you could get lame to read it properly with the right switches.

24bit files and LAME

Reply #23
Some decoders are compliant up to 16 bits, some up to more (up to 20, as an example).
But a 16bits decoder should be the same as another 16bits decoder.
If you are using a 24bits decoder and then burning an audio cd, you only have 16bits at the final step.

24bit files and LAME

Reply #24
Quote
BTW I think .wav and .aiff are the same thing, except aiff is big-endian and has a different header. They're both just PCM anyway - i bet you could get lame to read it properly with the right switches.
[a href="index.php?act=findpost&pid=335932"][{POST_SNAPBACK}][/a]


Confirmed - try the following:

lame -r -x --bitwidth 24 -s 48 file.aif file.mp3

This worked fine on Win2K with a 24-bit AIFF generated by Cool Edit.  Since CE didn't give me an option regarding endianness, I'm guessing it automatically saved it as little-endian, so while I didn't need the "-x", you'll probably need it on a Mac.
"Not sure what the question is, but the answer is probably no."