Amazon Developer

as

Settings
Sign out
Notifications
Alexa
Amazon Appstore
Ring
AWS
Documentation
Support
Contact Us
My Cases
Get Started
Design and Develop
Publish
Reference
Support
Skip to main content

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 successfully
  • STATUS_NO_INIT (-3): Stream not initialized
  • STATUS_BAD_VALUE (-2): Invalid parameters
  • STATUS_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 flushed
  • STATUS_NO_INIT (-3): Stream not initialized
  • STATUS_INVALID_OPERATION (-8): Cannot flush while playing
  • STATUS_DEAD_OBJECT (-5): Server communication error

Last modified on October 2, 2025