In our existing application, we use native messaging for audio functionality as our application predates WebAudio. We're looking to eliminate our native component and part of this involves audio playback. We've been using SoundTouch on the C# side for some time with no complaints so this seemed like a good choice.
The problem, however, is that our audio is very large; considerably more than will fit in an AudioBuffer. To handle this so far I'm using a custom audio worklet and streaming the audio with postMessage. However it's pretty unclear how to handle changing the playback rate. I thought that the intended outcome would be to resample the input, then supply this as if it's at the original sample rate and use SoundTouch to simply shift the pitch, which avoids buffer starvation as my source node can just stream faster for faster playback rates.
However this system results in choppy audio whether playing faster or slower so I'm feeling like I'm missing some core concept of how the playback rate changing should actually work.
Any thoughts on how the system is meant to work when using a custom audio source?
In our existing application, we use native messaging for audio functionality as our application predates WebAudio. We're looking to eliminate our native component and part of this involves audio playback. We've been using SoundTouch on the C# side for some time with no complaints so this seemed like a good choice.
The problem, however, is that our audio is very large; considerably more than will fit in an AudioBuffer. To handle this so far I'm using a custom audio worklet and streaming the audio with postMessage. However it's pretty unclear how to handle changing the playback rate. I thought that the intended outcome would be to resample the input, then supply this as if it's at the original sample rate and use SoundTouch to simply shift the pitch, which avoids buffer starvation as my source node can just stream faster for faster playback rates.
However this system results in choppy audio whether playing faster or slower so I'm feeling like I'm missing some core concept of how the playback rate changing should actually work.
Any thoughts on how the system is meant to work when using a custom audio source?