Skip to content

AudioPlayer

Defined in: audio-player.ts:251

Plays any number of inputs into one output node.

Type Parameter Default type
Output extends AudioPlayerGainNode AudioPlayerGainNode
readonly context: AudioPlayerContext;

Defined in: audio-player.ts:253

The context every input plays through.


readonly inputs: readonly AudioPlayerInput[];

Defined in: audio-player.ts:267

The inputs not yet removed.


readonly joinPhases: Readonly<AudioPlayerJoinPhases>;

Defined in: audio-player.ts:271

When the worklet module and the libopus module were ready, for measuring a join.


readonly output: Output;

Defined in: audio-player.ts:258

The mix of every input. Connect it to the context’s destination, or route it through createEchoCancellationLoopback so Chromium’s echo canceller hears it.


outputDelayUs: number;

Defined in: audio-player.ts:263

Delay after the output that the context does not report, in microseconds, such as an echo-cancellation loopback. Added to every input’s audible time. Default 0.

addInput(options?): AudioPlayerInput;

Defined in: audio-player.ts:265

Add an input.

Parameter Type
options? AudioInputOptions

AudioPlayerInput


close(): void;

Defined in: audio-player.ts:269

Remove every input and disconnect the output. The context stays the caller’s to close.

void