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

Add support for 24-bit samples in the audioop module #57075

Closed
PederJrgensen mannequin opened this issue Aug 30, 2011 · 10 comments
Closed

Add support for 24-bit samples in the audioop module #57075

PederJrgensen mannequin opened this issue Aug 30, 2011 · 10 comments
Assignees
Labels
extension-modules C modules in the Modules dir type-bug An unexpected behavior, bug, or error

Comments

@PederJrgensen
Copy link
Mannequin

PederJrgensen mannequin commented Aug 30, 2011

BPO 12866
Nosy @ezio-melotti, @merwok, @bitdancer, @serhiy-storchaka
Files
  • audioop24.c: Not ready for release, he probably wants to clean it up first.
  • audioop_24bit.patch
  • audioop_24bit_2.patch
  • 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 = <Date 2013-10-19.18:18:08.729>
    created_at = <Date 2011-08-30.22:51:52.086>
    labels = ['extension-modules', 'type-bug']
    title = 'Add support for 24-bit samples in the audioop module'
    updated_at = <Date 2013-10-20.06:43:28.967>
    user = 'https://bugs.python.org/PederJrgensen'

    bugs.python.org fields:

    activity = <Date 2013-10-20.06:43:28.967>
    actor = 'python-dev'
    assignee = 'serhiy.storchaka'
    closed = True
    closed_date = <Date 2013-10-19.18:18:08.729>
    closer = 'serhiy.storchaka'
    components = ['Extension Modules']
    creation = <Date 2011-08-30.22:51:52.086>
    creator = 'Peder.J\xc3\xb8rgensen'
    dependencies = []
    files = ['23075', '31619', '32135']
    hgrepos = []
    issue_num = 12866
    keywords = ['patch']
    message_count = 10.0
    messages = ['143239', '143417', '195471', '197018', '199900', '199906', '200008', '200462', '200467', '200548']
    nosy_count = 6.0
    nosy_names = ['ezio.melotti', 'eric.araujo', 'r.david.murray', 'python-dev', 'Peder.J\xc3\xb8rgensen', 'serhiy.storchaka']
    pr_nums = []
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue12866'
    versions = ['Python 3.4']

    @PederJrgensen
    Copy link
    Mannequin Author

    PederJrgensen mannequin commented Aug 30, 2011

    Hi,
    I'm working with audio in python 2.7 and I needed Audioop to work with
    24bit files, it currently only supports 8 16 and 32 bit sound files.
    (24bit files are very common in the audio world)
    My brother knows c quite well, so he managed to patch it up to support 24bit files for me, he's a bit too shy to try and get it into the standard python package him self, so I thought i'd give it a go for him :)

    I think the updated audioop.c would be a great add-on to python, it's 100% backwards compatible, and should work fine with python 3.
    I searched for hours and hours to see if someone had fixed it before, but found nothing.
    Not sure if this is the right place for this kind of thing, but was the best place I could find on python.org

    Also!
    The file i uploaded is not ready for release, my brother will probably want to go over it a few times and do more testing.

    @PederJrgensen PederJrgensen mannequin added the type-bug An unexpected behavior, bug, or error label Aug 30, 2011
    @merwok
    Copy link
    Member

    merwok commented Sep 2, 2011

    Welcome and thanks for your contribution! If I understand correctly, support for 24-bit files would be a new feature for audioop, so our development policy excludes 2.7, a stable release which only gets bug fixes. If you would like to turn your code into a patch (see guidelines in the devguide), it could be considered for inclusion in the next version.

    If you think your improvements would be useful for 2.7 users, you could rename your module to audioop2 and publish it on PyPI (pay attention to proper attribution and licensing).

    Feel free to ask any question! :)

    @ezio-melotti
    Copy link
    Member

    What's the status of this?

    @serhiy-storchaka serhiy-storchaka self-assigned this Aug 17, 2013
    @serhiy-storchaka
    Copy link
    Member

    Unfortunately Peter's file is not ready for release. It adds support of 24-bit samples only to the part of functions, it works only on little-endian platform, it should crash on platforms which not allows non-aligned access, and I suspect it can overflow output buffers. And it doesn't provided in diff format.

    Here is other patch which adds support for 24-bit samples. It also cleanup and simplify the code of audioop.c so that its total size is even decreased. Patch includes test and documentation changes.

    @serhiy-storchaka serhiy-storchaka added the extension-modules C modules in the Modules dir label Sep 5, 2013
    @serhiy-storchaka serhiy-storchaka changed the title Want to submit our Audioop.c patch for 24bit audio Add support for 24-bit samples in the audioop module Sep 5, 2013
    @serhiy-storchaka
    Copy link
    Member

    If there are no objections I will commit this.

    @PederJrgensen
    Copy link
    Mannequin Author

    PederJrgensen mannequin commented Oct 14, 2013

    This is great!
    My brother did a few more updates to it and added support for endian conversion, and i've been using it a lot with out any problems, but i must admit your patch looks a lot cleaner Serhiy. Great work. Can't wait to test it. This is going to be of great use to everyone working with audio in python.

    @serhiy-storchaka
    Copy link
    Member

    Updated patch addresses Antoine's comments.

    @python-dev
    Copy link
    Mannequin

    python-dev mannequin commented Oct 19, 2013

    New changeset e1fa70053828 by Serhiy Storchaka in branch 'default':
    Issue bpo-12866: The audioop module now supports 24-bit samples.
    http://hg.python.org/cpython/rev/e1fa70053828

    @serhiy-storchaka
    Copy link
    Member

    Thank you for your review Antoine.

    @python-dev
    Copy link
    Mannequin

    python-dev mannequin commented Oct 20, 2013

    New changeset 97ad9af5d5e7 by Serhiy Storchaka in branch 'default':
    Issue bpo-12866: Fix bias() for 24-bit. Add more tests.
    http://hg.python.org/cpython/rev/97ad9af5d5e7

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    extension-modules C modules in the Modules dir type-bug An unexpected behavior, bug, or error
    Projects
    None yet
    Development

    No branches or pull requests

    3 participants