refactor: python implementation of audioop.mul#2176
refactor: python implementation of audioop.mul#2176plun1331 merged 21 commits intoPycord-Development:masterfrom
audioop.mul#2176Conversation
|
A python equivalent will not be nearly as close as the C one in terms of performance. Live audio is a heavy load and has to be low latency. |
I mean we can always rewrite it in Rust. |
|
and also this largely uses python stdlib modules which from the seems of things are written in C in many places. |
The whole voice stuff could be rewritten to Rust 😬 |
Possible to do actual performance tests? |
only if :) |
|
Hmm that sure is a difference. Use |
|
Can we maintain and ship our own audioop C file? Dpy plans to do something like that Or we could try Cython or maybe Rust? |
Signed-off-by: Lala Sabathil <lala@pycord.dev>
|
bump |
|
Btw, that requested change is already resolved, not sure why it doesn't automatically detect it. |
Co-authored-by: Lala Sabathil <aiko@aitsys.dev> Signed-off-by: David Hozic <davidhozic@gmail.com>
The changelog thing? It was probably added through some weird auto-merge. |
…2176) * Replace audioop * style(pre-commit): auto fixes from pre-commit.com hooks * versionchanged * changelog * style(pre-commit): auto fixes from pre-commit.com hooks * speed * style(pre-commit): auto fixes from pre-commit.com hooks * changelog * Optimization (1 ms) * Update discord/player.py Co-authored-by: Dorukyum <53639936+Dorukyum@users.noreply.github.com> Signed-off-by: David Hozic <davidhozic@gmail.com> * Update CHANGELOG.md Co-authored-by: Lala Sabathil <aiko@aitsys.dev> Signed-off-by: David Hozic <davidhozic@gmail.com> --------- Signed-off-by: David Hozic <davidhozic@gmail.com> Signed-off-by: Lala Sabathil <lala@pycord.dev> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Dorukyum <53639936+Dorukyum@users.noreply.github.com> Co-authored-by: Lala Sabathil <lala@pycord.dev> Co-authored-by: plun1331 <plun1331@gmail.com> Co-authored-by: Lala Sabathil <aiko@aitsys.dev>
…2176) * Replace audioop * style(pre-commit): auto fixes from pre-commit.com hooks * versionchanged * changelog * style(pre-commit): auto fixes from pre-commit.com hooks * speed * style(pre-commit): auto fixes from pre-commit.com hooks * changelog * Optimization (1 ms) * Update discord/player.py Co-authored-by: Dorukyum <53639936+Dorukyum@users.noreply.github.com> Signed-off-by: David Hozic <davidhozic@gmail.com> * Update CHANGELOG.md Co-authored-by: Lala Sabathil <aiko@aitsys.dev> Signed-off-by: David Hozic <davidhozic@gmail.com> --------- Signed-off-by: David Hozic <davidhozic@gmail.com> Signed-off-by: Lala Sabathil <lala@pycord.dev> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Dorukyum <53639936+Dorukyum@users.noreply.github.com> Co-authored-by: Lala Sabathil <lala@pycord.dev> Co-authored-by: plun1331 <plun1331@gmail.com> Co-authored-by: Lala Sabathil <aiko@aitsys.dev>
|
Are there any plans or are the main maintainters open for rewriting some of the audio functionalities in Rust (for performance reasons)? |
Py-cord is meant to be used in (almost) all machines, and writing Rust implementations will prevent some machines to use it anymore because they cannot compile such code. |


Summary
This PR replaces the
PCMVolumeTransformer.read()method with a Python equivalent, that does not use theaudioopmodule, which is deprecated since Python 3.11 and will be removed in Python 3.13.This implements #2177.
Information
examples, ...).
Checklist
type: ignorecomments were used, a comment is also left explaining why.