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
A few useful additions to wavfile.py (24 bit read/write support, cue markers support, loop makers support, etc.) #6849
Comments
Thanks @josephernest. 24-bit support would indeed be nice. cross-linking the issue about that: gh-1930. |
Thanks @rgommers More informations: Normally
To keep backwards compatibility, I added parameters (default
Drawbacks of my code:
So in short, I'm open to do a pull request, but I'd need help :) |
@josephernest I got this started in gh-6852. Could you contribute a small test file that exercises the additional functionality? |
Here is a 24-bit 44.1 khz stereo WAV file named
With my API proposal here,
should return:
|
Thanks, no git shenanigans required! The test file you provided is pretty large (5.1MB vs a couple KB for most of the existing test fixtures). Is it possible to make a similar one with a tiny amount of data to keep filesize low? |
Here is a small test file. I won't go below 250 milliseconds, because testing if a loop works wouldn't make sense with a 10 ms sound file. |
Great, I've added this to the PR as a new test fixture. Thanks! |
Thanks! |
The write function for loops was broken, and few other things with markers, I made an updated version here https://github.com/X-Raym/wavfile.py It also fix various issues, like the loss of metadata (unsupported chinks are now supported), have LIST - INFO etc... |
@X-Raym Would you care to open a Pull Request for a more general audience? Then interested people can review and leave comments. Also your code can be tested against the existing codebase for regressions. |
@ilayn I will make further testing on my own, to be sure it works ok, and I'll do that, maybe in few days. Still, the script can be tested for those who needed (just download it from my repo). My own version may not respect Scipy conventions, as I don't know a lot of thing about it, apart from the original wavfile.py file. And just like Joseph code, I didn't write any updated usage doc for now. Thanks for your interest interest, I hope this will help make these features (especially 24bit support brought by @josephernest and unsupported chunks read/write I made) be merged in your project 🐱 |
@X-Raym , @ilayn , @josephernest , @perimosocordiae I'm wondering if anyone knows if this has moved forward since June of 2018. The ability to add markers would be particularly useful to me. thanks, |
(I have other WAV-related changes in my local repo, please bother me to make PRs out of them) |
I've modified the file https://github.com/scipy/scipy/blob/master/scipy/io/wavfile.py over the past years to add 24-bit WAV files read/write support, cue markers support, loop makers support, etc.
Here is the result.
If you're interested, feel free to reuse this / commit (I won't have time to do a pull request soon).
Note: In WAV audio files, 24-bit is probably the most used bitrate for instrument sample sets, music production, sound engineering; much more than 16-bit (CD) or 32-bit (used in music software as internal processing bitrate).
The text was updated successfully, but these errors were encountered: