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

Fix FLAC reading when seeking forward in a file or stream. #203

Merged
merged 1 commit into from
Mar 8, 2023

Conversation

psobot
Copy link
Member

@psobot psobot commented Mar 7, 2023

Fixes #201.

Versions of Pedalboard before this PR was merged have a bug in them in which seeking a FLAC file forward (i.e.: f.seek(x) where x > f.tell()) can - in some cases - produce silent output.

The tests we had that should have caught this bug were themselves subtly incorrect, as they always performed a read() over the start of the audio file, which avoided the buggy code path.

This PR:

  • Introduces more comprehensive, real-world tests for this behaviour (thanks @Gdalik!)
  • Fixes the underlying bug
  • Corrects the existing tests to catch this issue

@psobot psobot merged commit 4c5cf5a into master Mar 8, 2023
@psobot psobot deleted the psobot/seeking-flac-is-broken-again branch March 8, 2023 18:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Incorrect FLAC files reading after ReadableAudioFile.seek() to non-zero position on macOS Catalina
2 participants