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

Allow parsing MP3 file-like objects without a .name parameter. #191

Merged
merged 3 commits into from
Jan 17, 2023

Conversation

psobot
Copy link
Member

@psobot psobot commented Jan 17, 2023

Due to an underlying bug in JUCE's MP3 parser, Pedalboard was previously mis-identifying MP4 streams (and perhaps other formats too) as MP3 files, as long as a valid-looking MP3 header appeared in the first 32kB of the file. Pedalboard would detect this condition and throw an error like:

Failed to open audio file: file does not seem to be of a known or supported format. (If trying to open an MP3 file, ensure the filename ends with '.mp3'.)

...forcing the user to specify a format hint on the file-like object by setting its .name parameter to something that ends with .mp3.

This PR fixes the issue by patching the MP3 parser, which we can now do as we've vendored our own copy as part of #183. After merging and deploying, Pedalboard will no longer require file-like objects containing MP3 data to have .name parameters to parse correctly on Linux or Windows.

@psobot psobot added the bug Something isn't working label Jan 17, 2023
@psobot psobot merged commit fd24368 into master Jan 17, 2023
@psobot psobot deleted the psobot/allow-reading-mp3-from-stream branch January 17, 2023 20:02
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.

None yet

1 participant