Skip to content

GH-60729: Add IEEE format wave audio support take two#145931

Open
mbeijen wants to merge 13 commits intopython:mainfrom
mbeijen:GH-60729-add-ieee-wave-audio-support-take-2
Open

GH-60729: Add IEEE format wave audio support take two#145931
mbeijen wants to merge 13 commits intopython:mainfrom
mbeijen:GH-60729-add-ieee-wave-audio-support-take-2

Conversation

@mbeijen
Copy link
Contributor

@mbeijen mbeijen commented Mar 13, 2026

This is an updated version of #102574, the original PR where @lkoenig added support for IEEE Wave Audio.

As requested by @encukou

I've

  • Renamed the new 'getencoding/setencoding' to 'getformat/setformat' - format is the term used in the specifications
  • Added format to getparams
  • Added FACT chunk to written non-PCM wave files, which is required by the spec (and is what Audacity does)
  • Added documentation!

Closes: #102574

This is the new version of #145384 which got merged today AND reverted, because it failed on big-endian. Looking back I changed the test so it has the same structure as all other tests in test_wave.py and I ran it on an s390 docker image and tests are passing now for me. I was surprised there were no big endian tests on PRs only on main!! I'm sorry for the churn this caused.


📚 Documentation preview 📚: https://cpython-previews--145931.org.readthedocs.build/

lkoenig and others added 13 commits March 13, 2026 18:56
This adds support for floating point wav files and fix python#60729.
'format' is the term used in the wave audio specification
Per the RIFF/WAVE Rev. 3 documentation, non-PCM formats require a fact chunk, while PCM does not.
This is also what libsdnfile/audacity do

Reference: https://mmsp.ece.mcgill.ca/Documents/AudioFormats/WAVE/WAVE.html (see the 'fact Chunk' section and linked Rev. 3 RIFF docs).
These methods are public but were previously not documented. This caused
the unit tests to fail when I mentioned changes to getparams() in the
whats new ;-)
…CHTe.rst

Co-authored-by: AN Long <aisk@users.noreply.github.com>
Co-authored-by: Petr Viktorin <encukou@gmail.com>
This is also similar to what libsndfile does
Store the WaveIeeeFloatingPointTest frames data in big-endian
byte order with a conditional byteswap for little-endian systems,
matching the pattern used by all other PCM test classes.

This fixes test_read and test_read_not_from_start failures on
big-endian platforms (e.g. s390x).
@mbeijen mbeijen requested a review from AA-Turner as a code owner March 13, 2026 21:27
@mbeijen mbeijen changed the title Gh 60729 add ieee wave audio support take 2 GH-60729: Add IEEE format wave audio support take two Mar 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants