WebAudioPlaybackSession

Web playback session. Output device selection via AudioContext.setSinkId is deferred: the API is Chrome/Edge-only as of 2026 (unsupported in Firefox and Safari). Adding it would require feature-detected progressive enhancement and a device-passing API on the web playback path, which does not exist yet. AudioError.DeviceSelectionUnsupported remains the fallback behavior.

Constructors

Link copied to clipboard
constructor()

Properties

Link copied to clipboard
open override val audioFlow: StateFlow<AudioFlow?>

A flow that emits the current loaded audio data.

Link copied to clipboard
open override val state: StateFlow<AudioPlaybackSession.State>

A flow that emits the current state of the playback.

Functions

Link copied to clipboard
suspend override fun load(audioFlow: AudioFlow)

Loads the given audio data.

Link copied to clipboard
override fun pause()

Pauses the playback.

Link copied to clipboard
suspend override fun play()

Starts playback of the given audio data.

Link copied to clipboard
open suspend override fun playBlocking(audioFlow: AudioFlow)
Link copied to clipboard
open suspend override fun preparePlayback(format: AudioFormat): AudioFormat
Link copied to clipboard
override fun resume()

Resumes paused playback.

Link copied to clipboard
override fun stop()

Stops the playback entirely.