-
Notifications
You must be signed in to change notification settings - Fork 30
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
Wrong Frame Size for MPEG-2 #10
Comments
Thanks for reporting, if you have a test file you can share that would be helpful. |
I can't share the file I first ran into it with, but I found one online that is enough to reproduce: Sample
I believe any file using MPEG Version 2 or MPEG Version 2.5 will use the wrong frame length and not decode properly. Once it gets out of sync it ends up reading some invalid frame headers and invoking the wrong decoders (i.e. Layer I or II), causing an exception like the above. |
I'm not sure NAudio is correctly parsing the frames on that file either - I can't load it through the NLayer.NAudioSupport |
NAudio correctly parsed , But NAudio does not support android.
|
I was getting an exception when decoding MPEG Version 2. Figured out it was because the frame lengths were being calculated incorrectly. I believe the issue is here (in
MpegFrame.cs
):Compare to the length calculation used by NAudio:
I don't have access to the specs, but it looks like the hard-coded
144
is only going to be correct for MPEG-1 (when sample count is 1152). Appears to have solved my error switching to useSampleCount / 8
.The text was updated successfully, but these errors were encountered: