Skip to content
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

Wave.py support for ulaw and alaw audio #43330

Closed
ewoudenberg mannequin opened this issue May 7, 2006 · 7 comments
Closed

Wave.py support for ulaw and alaw audio #43330

ewoudenberg mannequin opened this issue May 7, 2006 · 7 comments
Labels
3.12 bugs and security fixes stdlib Python modules in the Lib dir type-feature A feature request or enhancement

Comments

@ewoudenberg
Copy link
Mannequin

ewoudenberg mannequin commented May 7, 2006

BPO 1483545
Nosy @amauryfa, @serhiy-storchaka
Files
  • wave.py_unified_diff.zip: unified diff from Lib/wave.py (At revision: 45934) to a wave.py with ulaw/alaw support
  • wave24.py: Wave.py from python 2.4 with patch applied
  • wave25.py: Wave.py from python 2.5 with patch applied
  • wave.py: Wave.py from python 2.7 with patch applied
  • test_wave.py: test_wave.py with added tests for ulaw and alaw format files.
  • 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 = None
    closed_at = None
    created_at = <Date 2006-05-07.23:23:39.000>
    labels = ['type-feature', 'library']
    title = 'Wave.py support for ulaw and alaw audio'
    updated_at = <Date 2014-08-25.07:32:51.887>
    user = 'https://bugs.python.org/ewoudenberg'

    bugs.python.org fields:

    activity = <Date 2014-08-25.07:32:51.887>
    actor = 'ewoudenberg'
    assignee = 'none'
    closed = False
    closed_date = None
    closer = None
    components = ['Library (Lib)']
    creation = <Date 2006-05-07.23:23:39.000>
    creator = 'ewoudenberg'
    dependencies = []
    files = ['7234', '13931', '13932', '36465', '36466']
    hgrepos = []
    issue_num = 1483545
    keywords = ['patch']
    message_count = 5.0
    messages = ['50204', '87462', '87463', '87499', '199865']
    nosy_count = 3.0
    nosy_names = ['amaury.forgeotdarc', 'ewoudenberg', 'serhiy.storchaka']
    pr_nums = []
    priority = 'normal'
    resolution = None
    stage = 'needs patch'
    status = 'open'
    superseder = None
    type = 'enhancement'
    url = 'https://bugs.python.org/issue1483545'
    versions = ['Python 2.7']

    @ewoudenberg
    Copy link
    Mannequin Author

    ewoudenberg mannequin commented May 7, 2006

    Dear Python Patch Center:

    This is my first Python patch submission. Apologies for
    any errors of protocol. I have been using these
    submitted changes for several years and have even given
    it out (I mentioned it a few years back on a python
    mailing list.) I am confident to the best of my ability
    that these changes are solid.

    Unfortunately I don't have the capability of rebuilding
    the documentation, but the changes to the documentation
    are outlined below.

    Please do not hesitate to contact me for further
    information or assistance. I would be honored to have
    these changes become part of some Python revision, be
    it 2.5 or something further in the future.

    Thank you,
    Eric Woudenberg
    eaw@connact.com

    From my version of the wave.py file:

    These changes allow .wav files containing u-law and
    a-law data to be read and written. The user visible
    changes are:

    1. After a .wav file containing mu-law or a-law data is
      opened for reading, a call to getcomptype() returns
      'ULAW' (resp. 'ALAW') and a call to getcompname()
      returns 'CCITT G.711 u-law' (resp. 'CCITT G.711 a-law').

    2. After a wave object is created for writing,
      setcomptype() can be called with the arguments ('ULAW',
      'CCITT G.711 u-law') (resp. 'ALAW', 'CCITT G.711
      a-law'). The second argument (text description) is ignored.

    3. The comptype 'PCM' is now a synonym for 'NONE'.
      PCM-containing wave files will return 'PCM' instead of
      'NONE' for their comptype.

    Note that this module does not do any u-law or a-law
    format conversion to PCM, it simply allows users to
    read or write u-law/a-law data from/to .wav files that
    have conforming headers. For audio conversion of PCM
    data to or from u-law, use the audioop module.

    @ewoudenberg ewoudenberg mannequin added stdlib Python modules in the Lib dir labels May 7, 2006
    @gpolo gpolo mannequin added type-feature A feature request or enhancement labels Jan 12, 2009
    @ewoudenberg
    Copy link
    Mannequin Author

    ewoudenberg mannequin commented May 8, 2009

    Patch applied to Python 2.4 wave.py

    @ewoudenberg
    Copy link
    Mannequin Author

    ewoudenberg mannequin commented May 8, 2009

    Patch applied to Python 2.5 wave.py

    @amauryfa
    Copy link
    Member

    amauryfa commented May 9, 2009

    Please read http://www.python.org/dev/patches/
    The best format for a patch is a "diff -u" format. It's much much easier
    to see what you changed to the existing code, and the same patch often
    applies to several versions.
    Also, 2.4 and 2.5 are closed for new developments - your changes would
    only go to a 2.7 version.

    And your change is more likely to be accepted if it contains unit tests
    (in Lib/test/test_wave.py)

    @serhiy-storchaka
    Copy link
    Member

    For consistency with the aifc and sunau modules the wave module should compress/uncompress u-law and A-law data.

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    @AA-Turner AA-Turner added pending The issue will be closed if no feedback is provided 3.12 bugs and security fixes labels Jun 7, 2022
    @AA-Turner
    Copy link
    Member

    These patches are targetting Python 2.7 and earlier so I would be surprised if they apply today -- I'd sugest closing this issue.

    A

    @kumaraditya303
    Copy link
    Contributor

    A new issue targeting main branch can be created if desired, also the patch would have to be a PR not a diff.

    @kumaraditya303 kumaraditya303 closed this as not planned Won't fix, can't repro, duplicate, stale Jun 18, 2022
    @AA-Turner AA-Turner removed the pending The issue will be closed if no feedback is provided label Jun 19, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    3.12 bugs and security fixes stdlib Python modules in the Lib dir type-feature A feature request or enhancement
    Projects
    None yet
    Development

    No branches or pull requests

    4 participants