Feature request use_audio as a reactive wrapper for web audio api
Feature request use_audio as a reactive wrapper for web audio api.
see https://rustwasm.github.io/wasm-bindgen/examples/web-audio.html, https://developer.mozilla.org/de/docs/Web/API/Web_Audio_API
A good starting point would could be implementing simple track playing functionality based on AudioBufferSourceNode etc.
Sounds interesting. But also quite a scope with this node based API.
How would you imagine the leptos-use implementation to be used? Can you provide sort of a pseudo rust code how you would like to be able to use it?
Maybe start with a simple useAudioPlayer.
let ap = useAudioPlayer();
...
let track_handle = ap.load(bytearray);
...
ap.play(track_handle);
...
ap.stop(track_handle);
I have implemented something similar, but my solution is far from optimal.
A wrapper for the whole WebAudio api could center around useAudioContext.
I'm not experienced enough in reactive api design to have a justified opinion on how that api should look though. Maybe some other js framework has a implementation that could be used as inspiration?