bbc / audiowaveform

C++ program to generate waveform data and render waveform images from audio files
https://waveform.prototyping.bbc.co.uk
GNU General Public License v3.0
1.94k stars 242 forks source link

Implement raw audio import format #194

Closed pascalhuerst closed 10 months ago

pascalhuerst commented 10 months ago

This is useful, if the data is stored in an s3 bucket or similar. This way, data can be written to stdin and read from stdout without the need to create temporary files.

This is proof of concept only. To implement this properly, the sample format needs to be specified on the command line. I would like to get some input on how to pass the sample format into the AudioFileReader. Currently no extra data is passed down the stack there.

Also no tests are implemented so far, but other than that, this seems to work fine already for my use case.

pascalhuerst commented 10 months ago

@chrisn I think i reworked according to your comments, maybe have another look whether this goes into the right direction. Still no doc/tests. Will add those once things look good.

chrisn commented 10 months ago

This is looking good. I'm going to add some error handling and tests. I have your branch checked out locally, so please don't force push!

pascalhuerst commented 10 months ago

I added some validation for the new options, and some test cases. I ended up needing to refactor the code a little, moving some code from OptionHandler into Options.

I think this is ready to merge. Would you mind testing this out on the raw files you're using?

Nice, thanks! - I will give it a try later today.

pascalhuerst commented 10 months ago

I added some validation for the new options, and some test cases. I ended up needing to refactor the code a little, moving some code from OptionHandler into Options.

I think this is ready to merge. Would you mind testing this out on the raw files you're using?

Works fine for my use case, which is a waveform generated from raw samples with 2 channels, 48000k and s16le, read from stdin. :tada:

Thanks a lot for your support @chrisn, I'm very happy to have this merged upstream.

chrisn commented 10 months ago

Thank you for contributing, I really appreciate it!