-
-
Notifications
You must be signed in to change notification settings - Fork 207
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
dr_wav append write? #211
Comments
No, unfortunately appending is not supported. The writing API was only really designed for basic use cases. |
Thanks. It might be complex to implement it to dr_wav. I have looked and I will have to have a deep understanding of the lib to be able to implement it. The way to do it: open file This lib is doing exactly that: https://github.com/justinfrankel/WDL/blob/master/WDL/wavwrite.h |
Yeah I'm not against adding support or anything. I'll mark this as a feature request and get to it when I can, but it could be a ways away. |
I qm already working on it. Might have it ready in a couple of hours |
I think I got it. I will need to do more testing, but so far it works great. Here are the changes/additions:
|
drwav_init_file_write_append__internal was made a bit more complicated but in this way falling to call drwav_uninit won't render the file unreadable. That basically means, if you create and write 3 seconds successfully, then close the file and open it again to append audio to it, but for some reason app crashes while writing data, and you don't call drwav_uninit (header data is not updated), the file will be still readable, and you will be able to play the first 3 seconds just fine. That is a pretty super feature to have. :) |
I have run some tests today, and it seems it's working as expected. |
Thanks for that sample code. I'll review this when I get a chance. |
Hi, is there a way for dr_wav to append data to a wav file when writing instead of rewriting the file?
The text was updated successfully, but these errors were encountered: