strudel icon indicating copy to clipboard operation
strudel copied to clipboard

sample preloading query loop

Open felixroos opened this issue 1 year ago • 2 comments

Currently, samples are lazily loaded when they are first needed. for most samples, this leads to unwanted silence, because the loading takes longer than the 100ms latency. It would be pretty useful if there was a separate query loop that preloads the samples with a higher latency, say x seconds. To ensure there is always at least a buffer of x seconds between preloading and playback, the initial play action would then need to query the first x*2 seconds. Then, after x seconds, the next x seconds are loaded and so on.

felixroos avatar Aug 14 '22 13:08 felixroos

with the offline support, this is partly solved because once you have sample, it will load almost instantly through the service worker

felixroos avatar Mar 03 '23 18:03 felixroos

I am using mp3s instead of wavs due to this issue, would be great to have a solution

How would it work? await samples(..., preload=True)? and then only start playing back once loading is complete?

jarmitage avatar Oct 31 '23 18:10 jarmitage