-
-
Notifications
You must be signed in to change notification settings - Fork 31.3k
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
Supporting extensible format(PCM) for wave.open(read-mode) #77171
Comments
The wave.Wave_read class currently supports 8, 16, 24, and 32 bit PCM files. According to the specification the WAVE_FORMAT_EXTENSIBLE format should be used whenever the actual number of bits/sample is not equal to the container size. Based on this specification, most applications export 24 bit PCM with the WAVE_FORMAT_EXTENSIBLE flag since 24 is stored in container size 32. The specification also explains how to detect 24PCM exported in this fashion as "The first two bytes of the GUID form the sub-code specifying the data format code, e.g. WAVE_FORMAT_PCM.". In essence, we have to look at the first two bytes of the SubFormat tag and that will tell us if this file is PCM. Based on this premise, it appears to me that there is no reason for not adding support for both format specification as the rest of the file is exactly the same for both. I am attaching a file that can be used to test the exception being raised. Source: http://www-mmsp.ece.mcgill.ca/Documents/AudioFormats/WAVE/WAVE.html |
I am currently working on a patch for this. When done can I try pushing this in 3.7 rather than 3.8? It is not much of an enhancement but rather fixing the code that raises an error for a perfectly valid PCM wave file (bugfix). |
Thanks for working on this. Please follow the process in our Developers Guide and submit a PR against the master branch (for 3.8). After a core developer reviews it and if it is accepted, we can then decide about backports to other release branches. Also, if you haven't already, please make sure to read the section on licensing and sign a contributor agreement: |
Andrea, are you still working on this issue? If not, I will submit a PR. |
The test file, a modified version of Lib/test/audiodata/pluck-pcm24.wav, was provided by Andrea Celletti on the bug tracker. Co-authored-by: Zackery Spytz <zspytz@gmail.com>
Reopening this to update docs to limit our support to only PCM files. |
Also to fix the SubFormat check. On further reading, I see that we need to check the entire SubFormat GUID, not just the last two bytes, as it could potentially be a non-standard format. |
…thonGH-97510) (cherry picked from commit dc9065f) Co-authored-by: Steve Dower <steve.dower@python.org>
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: