AudioPlayerInput
Defined in: audio-player.ts:189
One input of an AudioPlayer: one track, usually one speaker.
Properties
Section titled “Properties”gain: number;Defined in: audio-player.ts:201
The input’s gain.
joinPhases
Section titled “joinPhases”readonly joinPhases: Readonly<AudioInputJoinPhases>;Defined in: audio-player.ts:222
When each step of this input’s start happened, for measuring a join.
playbackRate
Section titled “playbackRate”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.
playoutLeadUs
Section titled “playoutLeadUs”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.
removed
Section titled “removed”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.
Methods
Section titled “Methods”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.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
range? |
AudioCutRange |
Returns
Section titled “Returns”void
push()
Section titled “push()”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.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
frame |
AudioPlayerFrame |
Returns
Section titled “Returns”void
remove()
Section titled “remove()”remove(): void;Defined in: audio-player.ts:218
Stop: the decoder closes, the worklet stops, and the clock goes to wall pacing.
Returns
Section titled “Returns”void