Skip to content

COM-14704 - Support WAVE_FORMAT_EXTENSIBLE in _read_wav for Python < 3.12#358

Merged
rsanchez87 merged 1 commit into
masterfrom
COM-14704
Apr 30, 2026
Merged

COM-14704 - Support WAVE_FORMAT_EXTENSIBLE in _read_wav for Python < 3.12#358
rsanchez87 merged 1 commit into
masterfrom
COM-14704

Conversation

@rsanchez87
Copy link
Copy Markdown
Contributor

@rsanchez87 rsanchez87 commented 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

Since WAVE_FORMAT_EXTENSIBLE shares the same PCM data layout, normalize the fmt tag to PCM (0x0001) before parsing

image

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 io and switch _read_wav to open WAVs from an in-memory buffer.
  • Normalize the WAV fmt tag from 0xFFFE to PCM (0x0001) before parsing with wave.
  • Expand _read_wav docstring to document the extensible behavior and Python version limitation.

Comment thread fluster/utils.py Outdated
Comment thread fluster/utils.py Outdated
Comment thread fluster/utils.py Outdated
Comment thread fluster/utils.py Outdated
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.
@rsanchez87 rsanchez87 merged commit a05c5e6 into master Apr 30, 2026
5 checks passed
@rsanchez87 rsanchez87 deleted the COM-14704 branch April 30, 2026 15:05
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

Successfully merging this pull request may close these issues.

3 participants