Re: general question about lame_encode_buffer()

Alexander Leidinger via Lame-dev <[email protected]> Mon, 13 Sep 2021 09:23:21 +0200
Newsgroups gmane.comp.audio.mp3.lame
Message-ID <20210913092321.Horde.BrxTlLJRYSBUxaDISAHCwRA@webmail.leidinger.net>
Quoting Jana Cole via Lame-dev <[email protected]> (from  
Mon, 13 Sep 2021 03:25:18 +0000):

> Windows Media Player plays 17 seconds of it, not the whole 37  
> seconds, and then it quits (and it sounds like the pitches have been  
> shifted up two octaves).

Are you sure the defaults (44.1kHz, 16bit) is correct for your input?  
If not you may want to set the correct values. See  
frontend/get_audio.c (you want to search for "set_input_").

You haven't used lame_encode_flush() at the end, so some data is  
missing at the end in your output.

You may want to update the lame tag in the MP3 (surely if it is a VBR  
mp3). I suggest you have a look at frontend/lame_main.c  
(lame_encoder_loop(), write_xing_frame()).

> My question: What exactly is in the unsigned char array I passed to  
> lame_encode_buffer()? Is it just mp3 frames? I didn't specify a  
> header or ID3 tags. Are there defaults for them?

If ID3 tags are set, some kind of ID3 tag would be written (by default  
ID3 tags are set to AUTO, which means LAME tries to do something  
sensible depending on what is set) to your buffer. So the buffer may  
contain morethan just MP3 audio data.

Bye,
Alexander.

-- 
http://www.Leidinger.net [email protected]: PGP 0x8F31830F9F2772BF
http://www.FreeBSD.org    [email protected]  : PGP 0x8F31830F9F2772BF