Fix issue in Layer3.js where last frame is dropped#19
Open
DeusExLibris wants to merge 2 commits intoaudiocogs:masterfrom
Open
Fix issue in Layer3.js where last frame is dropped#19DeusExLibris wants to merge 2 commits intoaudiocogs:masterfrom
DeusExLibris wants to merge 2 commits intoaudiocogs:masterfrom
Conversation
Member
|
I'll review this more in depth in a bit. For now, can you convert the tabs to 4 space indentation? Thanks! |
Author
|
Done - let me know if I missed anything |
Author
|
BTW, my original description of the issue - if you didn't see it - is here: #18 |
Author
|
I just discovered a related issue. If the audio is being streamed and the first block of data contains only the ID3 header, MP3Demuxer.probe fails even when it receives a valid ID3 header as it tries to read the first frame and it hasn't been received yet. I am working on a fix for this as well. |
Thalhammer
added a commit
to Thalhammer/mp3.js-ts
that referenced
this pull request
Jun 21, 2020
Merge of open pull request in parent project audiocogs/mp3.js#19
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
These updates fix an issue where Layer3#decode would drop the last frame when no next frame is available in the stream. This situation has the most impact if the audio stream is live - that is, taken from a live source. In this case, the aurora would receive the first chunk of audio - for example, four frames - and proceed to decode them. Four mp3 frames represents roughly 100msec of audio (depending on the sample rate) and takes roughly 20 msec to decode (depending on system capacity). In this instance, additional audio frames won't be received for roughly 100msec, so when Layer3#decode tries to reference the next frame while decoding the last frame in the chunk, it doesn't exist. Previously, this would cause an exception and jump out of mp3.js back to the try/catch in decoder#decode and consequently drop that last frame.