Skip to content

webaudio backend that uses AudioWorkletNode #663

Open
@lukaslihotzki

Description

@lukaslihotzki

Currently, the webaudio backend internally uses AudioBuffers chained together by AudioBufferSourceNodes' onended. These buffers need to be maintained regularly by the backend.

Web Audio has another type of node that closely resembles CPAL's API (translated to Javascript): AudioWorkletNodes regularly call the process callback in a separate thread to generate new samples.

Maybe, CPAL could implement an AudioWorkletProcessor that receives a WASM module and a SharedArrayBuffer and uses these to create a new WASM thread that is called each time in the process callback. This solution would provide more consistent behavior across platforms and could maybe reduce overhead and latency.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions