-
Notifications
You must be signed in to change notification settings - Fork 67
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
Broadcast Wav Extension Metadata #49
base: master
Are you sure you want to change the base?
Conversation
Thank you for taking the time to open a pull request, and writing a detailed description! The implementation looks clean. Thanks for adding tests and test samples as well, that is very useful. Supporting Broadcast Wav Extension Metadata sounds useful, I would like to merge this, but I’ve also come to realise that the current approach of having one
I think Broadcast Wav Extension Metadata would be a good fit for this "raw" layer. It would also make it a bit easier to deal with the " What do you think? |
That's great news! Thanks for asking for my opinion! I agree that the My thinking would be to add a You could then bolt on a Another idea that might be outside of the scope of a restructure would be giving this builder the option to accept a custom I haven't used the write side of the crate as much, so I can't really say what it might look like for writing arbitrary chunks too. |
Thinking more about the case for |
I just came here to ask for this feature. I am porting an extreme time stretch: https://github.com/spluta/TimeStretch to rust. I got a preliminary version working using your crate and rustfft. The file exports top out at around 2h45min (at least that is what the OS sees), but the nice thing is WavWriter actually writes all the data. Reaper opens the file just fine and Audacity will if I tell it to import Raw Data. Anyhow, it would be great to be able to just export an rf64 file, which I believe the BWF does. Thanks for the great work! Sam |
First off, thank you for this lovely, lovely crate.
This PR adds Broadcast Wav Extension Metadata parsing support. It should not be merged lightly, as it is a breaking change due to the additional
Chunks::Bext
enum variant. More than anything, I am opening this PR for visibility to others who may be looking for this feature and are willing to use this branch. Of course I would be happy if we can perfect the branch and merge it in the future, too.Some things of note:
There are multiple
String
allocations for theBwavExtMeta
fields that are parsed if the file in question has abext
chunk. Not only that, they are also cloned so thatBwavExtMeta
can be returned byChunksReader::next
andstill be accessed by
WavReader
. This is the most opinionated part that could be optimized away.Pro Tools, Reaper, and SoundDevice's WavAgent
bext
chunks are tested. WavAgent is most notable because it can add abext
chunk after thedata
chunk if it imported a wav file without abext
initially. This was tested by using Audacity to create the wav file initially.The
coding_history
is not parsed because I could not find or create any test files that use this field. It has been commented in theBwavExtMeta
struct declaration for clarity.A version 2
bext
is not tested also due to lack of test files.A
read_le_u64
method was added to theReadExt
trait.Cheers!