AudioInputOptions
Defined in: audio-player.ts:94
Options for AudioPlayer.addInput. Durations are microseconds.
Properties
Section titled “Properties”clock?
Section titled “clock?”clock?: AudioInputClock;Defined in: audio-player.ts:99
The broadcast’s playout clock. The input reports the audible timestamp to it about every 20 ms while it plays, and its target latency caps the jitter buffer. Without one, nothing is reported.
decoderConfig?
Section titled “decoderConfig?”decoderConfig?: AudioDecoderConfig;Defined in: audio-player.ts:101
How to decode. Default: Opus, 48 kHz, two channels; audioDecoderConfigFromTrack reads one from the catalog.
gain?: number;Defined in: audio-player.ts:103
The input’s gain. Default 1.
jitterTargetUs?
Section titled “jitterTargetUs?”jitterTargetUs?: number;Defined in: audio-player.ts:107
How much audio to hold before playing, at the start and after each underrun. Default 60,000.
maxJitterTargetUs?
Section titled “maxJitterTargetUs?”maxJitterTargetUs?: number;Defined in: audio-player.ts:115
The most the target grows to after underruns. Default 400,000, and never more than the clock’s target latency less the output delay and 40 ms: a frame further ahead of the clock than its target latency makes the frame sequencer resync.
minJitterTargetUs?
Section titled “minJitterTargetUs?”minJitterTargetUs?: number;Defined in: audio-player.ts:109
The least the target shrinks to while playback is smooth. Default 20,000.
playbackRate?
Section titled “playbackRate?”playbackRate?: number;Defined in: audio-player.ts:105
Held audio played per output frame, from 0.5 to 2; see AudioPlayerInput.playbackRate. Default 1.
Methods
Section titled “Methods”onCutHeard()?
Section titled “onCutHeard()?”onCutHeard?(atUs): void;Defined in: audio-player.ts:123
The latest cut() is heard: called once per cut, with AudioInputStats.cutHeardAtUs, when the jitter buffer’s
report says it applied it. A cut that a newer one overtook before it was applied is not reported. An exception from
it goes to console.error.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
atUs |
number |
Returns
Section titled “Returns”void
onError()?
Section titled “onError()?”onError?(error): void;Defined in: audio-player.ts:117
A decoder error. The input decodes again from the next frame, with a new decoder.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
error |
unknown |
Returns
Section titled “Returns”void