Constructors
new AudioPlaybackStream()
new AudioPlaybackStream(id): AudioPlaybackStream
Creates a new AudioPlaybackStream instance.
This constructor must not be called directly.
Use AudioPlaybackStreamBuilder.AudioPlaybackStreamBuilder.buildAsync to create instances.
Parameters
id
number
Internal stream identifier
Returns
AudioPlaybackStream
Properties
streamId
streamId:number
Methods
duckVolumeAsync()
duckVolumeAsync(mode, value, rampDurationMs): Promise<number>
Adjusts the volume of the stream for ducking purposes.
Only effective when using EXPLICIT ducking policy.
Parameters
mode
number
DB (0) or PERCENTAGE (1)
value
number
Amount to reduce volume:
- For
DB: 0-144 dB reduction - For
PERCENTAGE: 0-100% reduction
rampDurationMs
number
Time in milliseconds to reach target volume
Returns
Promise<number>
A promise that resolves to:
STATUS_NO_ERROR (0): Volume ducked successfullySTATUS_NO_INIT (-3): Stream not initializedSTATUS_BAD_VALUE (-2): Invalid parametersSTATUS_INVALID_OPERATION (-8): Wrong ducking policy
flushAsync()
flushAsync():Promise<AudioStatus>
Flushes all buffered data without changing the playback state.
Returns
Promise<AudioStatus>
A promise that resolves to:
STATUS_NO_ERROR (0): Successfully flushedSTATUS_NO_INIT (-3): Stream not initializedSTATUS_INVALID_OPERATION (-8): Cannot flush while playingSTATUS_DEAD_OBJECT (-5): Server communication error

