wasm-audio-decoders
wasm-audio-decoders copied to clipboard
How to playback decoded audio
Hi,
I'm having some difficulties with the opus decoder, would you be able to answer a few questions over email?
You can contact me at [email protected] if this is ok?
Thanks
Hi, we can discuss here in this issue if you don't mind. I like to keep these discussions public so that if someone else also has a similar issue they will be able to refer back here.
Hi, we can discuss here in this issue if you don't mind. I like to keep these discussions public so that if someone else also has a similar issue they will be able to refer back here.
How would you recommend playing the audio data (with minimal latency) in the browser, from the decodeFrame
callback?
You can use the Web Audio API to play back the decoded results. You can asynchronously decode using OpusDecoderWebWorker.decodeFrame
, put the results into an AudioBuffer
, and playback the buffer using an AudioBufferSourceNode
.
Here are a few examples of where I use this library to decode audio and playback through the Web Audio api:
Just ran into this issue, I solved it using this code. I hope this helps someone
https://github.com/samirkumardas/pcm-player/issues/11#issuecomment-788322380
Thanks all for the input, closing since there are a number of examples noted here.