COM-14704 - Support WAVE_FORMAT_EXTENSIBLE in _read_wav for Python < 3.12#358
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
Adds a compatibility workaround so Fluster can read Dolby reference WAV outputs using WAVE_FORMAT_EXTENSIBLE on Python versions older than 3.12 (where wave rejects fmt tag 0xFFFE).
Changes:
- Import
ioand switch_read_wavto open WAVs from an in-memory buffer. - Normalize the WAV fmt tag from
0xFFFEto PCM (0x0001) before parsing withwave. - Expand
_read_wavdocstring to document the extensible behavior and Python version limitation.
rgonzalezfluendo
approved these changes
Apr 30, 2026
The Dolby reference decoder outputs WAV files using WAVE_FORMAT_EXTENSIBLE
(fmt tag 0xFFFE). Python's wave module only added support for this format
in 3.12, causing all AC4 fluster tests to fail on Python 3.10 with:
wave.Error: unknown format: 65534
On wave.Error, locate the fmt chunk in the RIFF structure and patch only
the wFormatTag field to PCM (0x0001) — the data layout is identical.
Extract _extract_wav() as a helper to avoid duplicating the read logic.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The Dolby reference decoder outputs WAV files using WAVE_FORMAT_EXTENSIBLE (fmt tag 0xFFFE). Python's wave module only added support for this format in 3.12, causing all AC4 fluster tests to fail on Python 3.10 with:
Since WAVE_FORMAT_EXTENSIBLE shares the same PCM data layout, normalize the fmt tag to PCM (0x0001) before parsing