You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Worker should offload the main thread. But I'm not sure what code we can put inside of it. FYI audio processing is already done inside AudioWorkletProcessors, which are run on a separate thread.
Reason: it's best for silenceDetector.onmessage (specifically in the StretchingController) listener to get executed as fast as possible because it is responsible for playback rate changes.
It thought that the best thing would be to put the silenceDetector.onmessage listener to a Worker and that's it, but unfortunately DOM is not accessible from inside workers, so I thought maybe we could go the other way around and put everything else inside a Worker. For example, all the event listeners (addEventListener and onMessage). They also usually access DOM, so we're gonna need some interfacing as well. Although I'm not sure if sending data to a Worker would be more efficient than just processing the event in-place.
Another idea I had is to put a bunch of queueMicrotasks (or setTimeouts) everywhere across the code so that it has a chance of getting interrupted by the silenceDetector.onmessage listener.
Also need to keep in mind the requestIdleCallback.
The text was updated successfully, but these errors were encountered:
Worker
should offload the main thread. But I'm not sure what code we can put inside of it. FYI audio processing is already done insideAudioWorkletProcessor
s, which are run on a separate thread.Reason: it's best for
silenceDetector.onmessage
(specifically in theStretchingController
) listener to get executed as fast as possible because it is responsible for playback rate changes.It thought that the best thing would be to put the
silenceDetector.onmessage
listener to a Worker and that's it, but unfortunately DOM is not accessible from inside workers, so I thought maybe we could go the other way around and put everything else inside a Worker. For example, all the event listeners (addEventListener
andonMessage
). They also usually access DOM, so we're gonna need some interfacing as well. Although I'm not sure if sending data to aWorker
would be more efficient than just processing the event in-place.Another idea I had is to put a bunch of
queueMicrotask
s (orsetTimeout
s) everywhere across the code so that it has a chance of getting interrupted by thesilenceDetector.onmessage
listener.Also need to keep in mind the
requestIdleCallback
.The text was updated successfully, but these errors were encountered: