- TOC
Required services
The API requires declaration of the system audio services:Types Used
Refer to Audio core typesAudioStatusAudioAttributesAudioContentTypeAudioUsageTypeAudioFlagsAudioConfigAudioSampleRateAudioSampleFormatAudioSource
Static Methods
AudioPlaybackStreamBuilder.destroyAsync(playbackStream)
Description
Destroys an AudioPlaybackStream object specified in the parameters.Return Value
Returns a promise that resolves to an AudioStatus type.Parameters
Example code
Methods
buildAsync()
Description
Creates a new AudioPlaybackStream object.Return Value
Returns a promise that resolves to an AudioPlaybackStream object.Example code
setAudioConfig(config)
Description
Sets the audio configuration for the playback stream.Return Value
No return value.Parameters
Example code
reset()
Description
Resets audio playback builder configuration.Return Value
No return value.Example code
setAudioAttributes(attributes)
Description
Sets audio playback builder attributes.Return Value
No return value.Parameters
Example code
setFramesPerBuffer(framesPerBuffer)
Description
Configures buffer the capacity for frame count in the shared memory buffer queue. This is used to determine the buffer size per slot in the shared memory buffer queue.Return Value
No return value.Parameters
Example code
setAudioFocusSessionId(focusSessionId)
Description
Sets the audio focus session id for the audio playback builder. The focus session id is obtained by creating anAudioFocusSession object and accessing it directly.
Return Value
No return value.Parameters
Example code
AudioFocusSession object.

