Skip to content

AudioPlayerInput

Defined in: audio-player.ts:189

One input of an AudioPlayer: one track, usually one speaker.

gain: number;

Defined in: audio-player.ts:201

The input’s gain.


readonly joinPhases: Readonly<AudioInputJoinPhases>;

Defined in: audio-player.ts:222

When each step of this input’s start happened, for measuring a join.


playbackRate: number;

Defined in: audio-player.ts:207

Held audio played per output frame, from the next render quantum: above 1 sheds latency, below 1 gains it, and pitch shifts with it (no time-stretching). From 0.5 to 2. Held audio, the jitter target, trims and the hard bound stay measured in held audio, and reports carry the timestamp at the fractional read position.


readonly playoutLeadUs: number;

Defined in: audio-player.ts:216

How far ahead of the playout clock’s position the input wants frames, in microseconds: the output delay (the context’s baseLatency and outputLatency and the player’s outputDelayUs) plus the jitter target now. A frame sequencer under timestamp playout releases held frames this far ahead (timestampPlayout: { leadUs: () => input.playoutLeadUs }), so the input holds about its target of audio and nothing is trimmed.


readonly removed: boolean;

Defined in: audio-player.ts:220

Whether remove() or the player’s close() was called.


readonly stats: Readonly<AudioInputStats>;

Defined in: audio-player.ts:209

Counters, refreshed with each report from the worklet.

cut(range?): void;

Defined in: audio-player.ts:199

Drop audio already received in a timeline range, held or still decoding, as at a talker’s interruption. No range drops everything held, as a flush does.

Parameter Type
range? AudioCutRange

void


push(frame): void;

Defined in: audio-player.ts:194

Decode and buffer a frame, in decode order. A frame reader’s onFrame can be this. A resync or restart discontinuity also flushes what is held: it belongs to the replaced timeline.

Parameter Type
frame AudioPlayerFrame

void


remove(): void;

Defined in: audio-player.ts:218

Stop: the decoder closes, the worklet stops, and the clock goes to wall pacing.

void