-
Notifications
You must be signed in to change notification settings - Fork 198
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
What size is the begin/end padding measured in samples and/or duration? #45
Comments
Hi @VRciF |
There is no easy solution to splicing multiple mp3 files seamlessly. Why it's hard and how to do it is described in the LAME Technical FAQ linked above. |
Hi @geeee, I'll look into the process of sending an MP3 stream in chunks, since I'm sure that would be the more elegant solution. I didn't consider this as strongly before because I was just going for something quick and dirty that I could easily work into the framework of an existing project where WAV data is put in base64 and then sent over a websocket at a certain interval. I thought it might be quick to just throw in the extra step of converting the WAV data to MP3 before the base64 encoding so I could make minimal changes. Seems like it might not be that simple though I guess. |
Padding at the start is going to be 576 samples. Padding at the end will vary. At the very least it's going to be 288 samples. And more silence to make the total number of samples exact multiple of 1152. And on top of that decoders might also contribute by adding even more silence. |
Thanks very much, I will try that! |
Many thanks for this great library.
I'm trying to encode the microphone recorded from the browser using lamejs.
The encoded chunks are then sent to another browser tab using a nodejs websocket server and decoded using audioContext.decodeAudio which works great.
The websocket connections are handled in a web worker thread and if i send the raw pcm data i have no glitches in the audio output. But using the encoded mp3 chunks i get crackling noises.
I noticed that the mp3 chunks are around 50ms longer in duration the decoded chunk is also around 2000 bytes bigger.
I tested to encode pcm samples of a fixed value. The decoded audio then seems to have a padding of around 25ms at the beginning and end of the mp3 which seems to be just how mp3 works according to lame faq.
So i tried to just ignore 25ms at the beginning and end and the crackling got better but is still there.
My question is: Is there a way that i know exactly how many samples or duration has been added to the beginning and end of the mp3? Is it encoded in the mp3 as mentioned in the faq from above or is it some kind of fixed value?
Kind regards
The text was updated successfully, but these errors were encountered: