GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — wave file module does not support 32bit float format · Issue #60729 · python/cpython

wave file module does not support 32bit float format #60729

New issue
Copy link
New issue
Copy link
Closed
Closed
wave file module does not support 32bit float format#60729
Copy link
Assignees
serhiy-storchaka
Labels
stdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytype-featureA feature request or enhancementA feature request or enhancement

Description

seebk
mannequin
opened on Nov 21, 2012
Issue body actions
BPO 16525
Nosy @jcea, @mdickinson, @serhiy-storchaka, @jleedev
Files
  • wave_read_issue16525.patch
  • wave_issue16525_updated.patch
  • wave_issue16525_doc.patch: Documentation patch clearly defining the supported sample formats
  • 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:

    assignee = 'https://github.com/serhiy-storchaka'
    closed_at = None
    created_at = <Date 2012-11-21.20:13:47.301>
    labels = ['extension-modules', 'type-feature', 'expert-IO']
    title = 'wave file module does not support 32bit float format'
    updated_at = <Date 2020-10-15.18:42:18.176>
    user = 'https://bugs.python.org/seebk'

    bugs.python.org fields:

    activity = <Date 2020-10-15.18:42:18.176>
    actor = 'jleedev'
    assignee = 'serhiy.storchaka'
    closed = False
    closed_date = None
    closer = None
    components = ['Extension Modules', 'IO']
    creation = <Date 2012-11-21.20:13:47.301>
    creator = 'seebk'
    dependencies = []
    files = ['29079', '29085', '34264']
    hgrepos = []
    issue_num = 16525
    keywords = ['patch']
    message_count = 14.0
    messages = ['176077', '176085', '176086', '176284', '176291', '176292', '176293', '176374', '176741', '180132', '182150', '182217', '182316', '212542']
    nosy_count = 6.0
    nosy_names = ['jcea', 'mark.dickinson', 'serhiy.storchaka', 'seebk', 'jleedev', 'harveyormston']
    pr_nums = []
    priority = 'normal'
    resolution = None
    stage = 'patch review'
    status = 'open'
    superseder = None
    type = 'enhancement'
    url = 'https://bugs.python.org/issue16525'
    versions = ['Python 3.4']

    Linked PRs

    • gh-60729: Add support for floating point wave files. #102574
    • GH-60729: Add IEEE format wave audio support #145384
    • GH-60729: Revert "Add IEEE format wave audio support (GH-145384)" #145928
    • GH-60729: Add IEEE format wave audio support take two #145931
    • gh-60729: Add missing versionadded/versionchanged tags to wave module #159644
    • [3.15] gh-60729: Add missing version{added,changed} directives to the wave docs (GH-159644) #160079

    Activity

    Next
    1. seebk commented on Nov 21, 2012

      @seebk
      seebkmannequin
      on Nov 21, 2012
      MannequinAuthor
      More actions

      The wave module cannot read audio WAV files containing 32bit float values. This is a very common file type for professional audio!

      There has already been a patch some years ago which works fine but was finally not applied. I can confirm that it does not break anything and only adds support for a new number format.

      http://bugs.python.org/issue1144504

    2. seebk
      added
      extension-modulesC modules in the Modules dirC modules in the Modules dir
      topic-IO
      type-featureA feature request or enhancementA feature request or enhancement
      on Nov 21, 2012
    3. jcea commented on Nov 22, 2012

      @jcea
      jcea
      on Nov 22, 2012
      Member
      More actions

      This is a new feature. Targeting Python 3.4.

    4. jcea commented on Nov 22, 2012

      @jcea
      jcea
      on Nov 22, 2012
      Member
      More actions

      Can somebody point to a floating point WAVE specification?.

      I think the issues raised in the original bug still stands. Also, support for writing should be provided too.

      http://web.archive.org/web/20080924064943/http://ccrma.stanford.edu/CCRMA/Courses/422/projects/WaveFormat/

      http://www-mmsp.ece.mcgill.ca/Documents/AudioFormats/WAVE/WAVE.html

    5. seebk commented on Nov 24, 2012

      @seebk
      seebkmannequin
      on Nov 24, 2012
      MannequinAuthor
      More actions

      Write support is no problem, I will add this.

      From reading the spec in the link you provided I think the implementation in general is OK.

      Everything apart WAVE_FORMAT_PCM should have an extension size cbSize, that's right. But only WAVE_FORMAT_EXTENSIBLE sets cbSize=22.
      So for read access it is not mandatory to check the value when WAVE_FORMAT_IEEE_FLOAT, but for writing files I would set this to zero.

      There are several other wave formats which also use float data, but most important is WAVE_FORMAT_IEEE_FLOAT, and that can be suppoted quite easily without many changes.

    6. jcea commented on Nov 24, 2012

      @jcea
      jcea
      on Nov 24, 2012
      Member
      More actions

      Sebastian, Could you possibly write a patch with a test?.

      Could you possibly fill a contributor agreement? Details in http://www.python.org/psf/contrib/

    7. seebk commented on Nov 24, 2012

      @seebk
      seebkmannequin
      on Nov 24, 2012
      MannequinAuthor
      More actions

      I will create a patch together with a testset of example files and also fill out the agreement.

      BTW: readframes() returns bad data for 24bit PCM if big_endian==True. Furthermore IMO it doesn't make sense to return a byte stream in little endian order on a big endian system... What do you think? At least the waves doc doesn't mention or specify the endianess which will cause trouble.

    8. jcea commented on Nov 24, 2012

      @jcea
      jcea
      on Nov 24, 2012
      Member
      More actions

      About the 24 bit PCM bug, please fill another bug.

    9. seebk commented on Nov 25, 2012

      @seebk
      seebkmannequin
      on Nov 25, 2012
      MannequinAuthor
      More actions

      Attached to this mail you find my patch for the implementation of support for 8, 16, 24, 32 bit signed int PCM and 32, 64 bit float.

      24bit on big endian systems is buggy, but this will be reported in another ticket.

      The modified test checks all number formats apart form 24bit int. If the patch is fine and will be accepted I will also update the doc and send a seperate patch for this.

    10. seebk commented on Dec 1, 2012

      @seebk
      seebkmannequin
      on Dec 1, 2012
      MannequinAuthor
      More actions

      Contribution agreement is now attached to my account. So the review can start ;)

    11. seebk commented on Jan 17, 2013

      @seebk
      seebkmannequin
      on Jan 17, 2013
      MannequinAuthor
      More actions

      Any news or feedback regarding my patch?

    12. harveyormston commented on Feb 15, 2013

      @harveyormston
      harveyormstonmannequin
      on Feb 15, 2013
      Mannequin
      More actions

      I see that this issue applies to Python 3.4. Nevertheless, I am now using the submitted patch (http://bugs.python.org/file28122/wave_float_issue16525.patch) with Python 2.7.

      I find that the patched module fails when calling getwavformat(), becuase the _wavformat attribute is not set.

      I attach wave_read_issue16525.patch, which properly sets the _wavformat attribute and allows getwavformat() to succeed.

      Apologies if I have not followed the proper process here. I found this patch a while ago while looking for a solution to the limitations in the standard wave module and, upon using the patch, identified this potential issue which I have attampted to fix. I thought it would be best to share that fix.

    13. seebk commented on Feb 16, 2013

      @seebk
      seebkmannequin
      on Feb 16, 2013
      MannequinAuthor
      More actions

      Thanks for the hint Harvey!
      I have updated my patch to include your changes, but only applied the second hunk for the following reasons:

      Wave_read should not assume any wave format, as it is expected to open a file during initialization. So actually the only missing thing was the assignment of the wave format during the reading of the format chunk.

      setparams() in Wave_write already sets the wavformat a few lines later together with the other parameters. So no need to set it twice...

      Can you please check if the updated patch works for you?

    14. 17 remaining items

    15. encukou
      added 2 commits that reference this issue on Mar 13, 2026

      Revert "pythonGH-60729: Add IEEE format wave audio support (pythonGH-…

      fcb8c9d

      GH-60729: Revert "Add IEEE format wave audio support (GH-145384)" (GH…

      747ef70
    16. mbeijen
      added a commit that references this issue on Mar 13, 2026

      Add support for floating point wave files.

      This issue will close once commit bb8e258 is merged into the 'main' branch.
      bb8e258
    17. encukou
      added 2 commits that reference this issue on Mar 18, 2026

      Merge branch 'main' into pythonGH-60729-add-ieee-wave-audio-support-t…

      27c0ddb

      GH-60729: Add IEEE format wave audio support (GH-145931)

      d42a04c
    18. ljfp
      added 3 commits that reference this issue on Apr 25, 2026

      pythonGH-60729: Add IEEE format wave audio support (pythonGH-145384)

      038aa29

      pythonGH-60729: Revert "Add IEEE format wave audio support (pythonGH-…

      0528f01

      pythonGH-60729: Add IEEE format wave audio support (pythonGH-145931)

      aa3aa81
    19. serhiy-storchaka
      added
      stdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directory
      and removed
      extension-modulesC modules in the Modules dirC modules in the Modules dir
      topic-IO
      on Jul 3, 2026
    20. serhiy-storchaka commented on Jul 3, 2026

      @serhiy-storchaka
      serhiy-storchaka
      on Jul 3, 2026
      Member
      More actions

      Support for WAVE_FORMAT_IEEE_FLOAT was added in GH-145931.

    21. serhiy-storchaka
      closed this as completedon Jul 3, 2026
    22. StanFromIreland
      added 2 commits that reference this issue on Oct 21, 2026

      gh-60729: Add missing `version{added,changed}` directives to the `wav…

      69d0f96

      [3.15] gh-60729: Add missing `version{added,changed}` directives to t…

      c195599
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

    Metadata

    Metadata

    Assignees

    • @serhiy-storchaka
      serhiy-storchaka

    Labels

    stdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytype-featureA feature request or enhancementA feature request or enhancement

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402503 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.