Skip to content
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

LAME tags are not parsed, leading to an incorrect length calculation #263

Open
slouken opened this issue Jan 14, 2024 · 1 comment
Open

Comments

@slouken
Copy link
Contributor

slouken commented Jan 14, 2024

When decoding https://github.com/py-sdl/py-sdl2/blob/master/sdl2/test/resources/soundtest.mp3, the correct length is 0.1502 seconds, but when using dr_mp3, the reported length is 0.209 seconds.

This can cause silence to be played incorrectly, which is especially a problem when looping MP3 files.

This was reported to SDL_mixer in libsdl-org/SDL_mixer#439 and was solved by switching from dr_mp3 to minimp3.

@eXpl0it3r
Copy link

Am I understanding this correctly, that this wouldn't just need the parsing of the Xing / Info tag itself, but also subtracting the delay and padding?

In the SFML tests we're getting a relatively large difference in time and sample count. Additionally, the first few samples seem to be zero values instead of the actual sample.

Values on the right is what minimp3 reported:

  CHECK( inputSoundFile.getSampleCount() == 87'798 )
with expansion:
  91008 (0x16380) == 87798 (0x156f6)

  CHECK( inputSoundFile.getDuration() == sf::microseconds(1'990'884) )
with expansion:
  2063673us == 1990884us

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants