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
porting 24bit wave support #94
Comments
It can be done as shown here and I've heard that the std lib |
Well, if you send some code I can test in python 2.7 |
FYI: The small |
wavio looks like a great module - the thing that bothers me about switching from the stdlib wave module to wavio is the numpy dependency. Right now pydub doesn't require users to have a C compiler installed, which is a big hassle for less experienced developers (and even for experienced ones, it can be a source of yak shaving). I think for users who would like to work on 24-bit wave files, I'd encourage them to convert it to 32 bit and then work on the 32 bit file in pydub. This is, admittedly, not a very elegant solution, but for casual users 24-bit wave files aren't very common, and for more sophisticated users using 32 bit audio is generally not is huge problem. |
Hello. I have suggestion. |
here is what @sg3510 used on dejavu to allow 24-bit support |
@WarrenWeckesser Excuse me for the ignorance, but I want to ask the question: Can we convert the code to not use the numpy module? @jiaaro can we think of adding wavio or wavio-like option so that when we have a 24bit file we use the that option? |
@thesunlover That's an old (but perfectly functional) version of the wavio module, from when it was in a gist on github. The new version (now in a github repo and on pypi) has a different API. All the versions depend on numpy. @jiaaro I understand trying to avoid dependencies that aren't pure python. Python has been around for decades and the packaging problem still isn't completely solved. However, I've been using numpy for so long that I cringe at the thought of trying to do any nontrivial computational work in python without it. The dependency on numpy could be removed--it's "just" a matter of writing more code. 😄 |
@jiaaro in my experience with coding with python I have always wondered on the pre-compiled modules. These are probably C or C++ or some other kind of very optimized computational libaries. Edit: Please excuse me, I will be off-topic here: |
I experimented a bit, but it looks like full support for 24 bit in pydub is not a quick fix (e.g.
I don't know if this is a reasonable approach for pydub, but the option might be useful for some users, especially if true 24 bit support is not going to be added soon. |
👍
Can we suggest a PR in AudioSegment repository? |
oh, I forgot to ask if it is going to work with huge files like 2-3 hours long audio files? (I am concerned about this ;) ) |
What is the sample rate? These lines should be tweaked to avoid creating full lists where possible (e.g. in Python 2, use
|
32bit 44100Hz if not wrong when using the 'Hz' |
This support is based on the conversation in issue #94
this should be working on v0.16.3 :) |
Sounds cool. Would love to see test on that. Thanks |
@thesunlover I'm not sure what kind of tests you mean, but I added unit tests, one of which opens a 24-bit wave file (that I exported from Logic Pro X) |
oh, sorry, I wrote wrong words. I already saw the tests with the 24-bit wave file. I mean that I want to run it. I would run on my Windows machine and also will look for some time to check all tests on windows as well(I saw there is an issue on windows tests) |
Hi everyone, new to pydub, my original wav file is 24-bit, use pydub to manipulate it in 32-bit, then use wavio to write to 24-bit. There is some sound distortion after conversion. And I also try to use AudioSegment(…).set_sample_width(3), but it doesn't work. Can anyone help? Is there any good way to convert to 24bit? Thank you. |
According to wavio lib
https://github.com/WarrenWeckesser/wavio
there is portable 24bit support.
The text was updated successfully, but these errors were encountered: