workerOutputBackend

fun workerOutputBackend(port: JsAny, sampleRate: Int, channels: Int, outputLatencySeconds: Double?, control: (resume: Boolean) -> Unit): OutputBackend

The output backend of a player that runs in a Web Worker (#100): the worker's clock, and a sink that writes to the page's worklet through port, the WebWorkletAudio.workerPort the page transferred. sampleRate, channels and outputLatencySeconds are the page's figures.

A worker cannot start or stop the page's device, so control asks the page to: true to resume and false to suspend. The page decides; a browser starts audio only inside a user gesture.

An application uses KitePlayerWorker in kiteplayer, which builds this inside its worker.