Closed jozanza closed 3 years ago
@zbaylin Sure! Do you want the example as part of this PR or another one after this is merged?
@jozanza I think here, if you don't mind! Let me know if you need any assistance! (you seem to know what you're doing though haha)
Thanks for the awesome contribution, @jozanza - this looks great! Wanted an Audio API for a while π
Just some minor feedback:
An example like @zbaylin mentioned would be helpful to showcase this work. We could use the the File Dialog
to have the user choose a sound file, or, bundle one for testing in the example app - there's a lot of great ones in opengameart.org, like: https://opengameart.org/content/beep-tone-sound-sfx
Had a minor comment on the open_
API - having it return an option
to account for the negative return value / failure case.
@bryphe while working on the example for wav playback, I wound up adding more SDL2 Audio API bindings. So this PR might need a second pass for review. @zbaylin the example is fairly basic, so if you've got any cool ideas, feel free to jump in and add/change whatever you want. It'd probably be good to at least test it out to make sure it also works properly for other people besides me π
Example looks great @jozanza - thanks for adding the progress bar / start / end times - very nice π
Too bad the gif doesn't have sound... but it works well:
The example is awesome! Thanks @jozanza! Looks like @bryphe approved it so I can merge this in!
After seeing it mentioned in the roadmap, this issue, and wanting it for my own personal Revery project, I added some WAV file playback support.
The interface exposed is a fairly straightforward mapping to a subset of SDL's Audio API. If we want to expose more of the SDL Audio API or would like to work on a higher-level Revery Audio API, I'd be happy to help out there.
Example Usage:
I wasn't exactly sure what the best approach for testing and web support was, so I'd appreciate some direction. Cheers! π