onStreamStateChanged

open fun onStreamStateChanged(stream: AudioStream, state: StreamState)

Called when the stream's lifecycle state changes.

This is called on a platform thread (not the real-time audio thread) and may be used to update UI or log state transitions. Avoid long-running work to prevent blocking the platform's audio management.

Parameters

stream

The stream whose state changed.

state

The new StreamState. See StreamState for the full lifecycle diagram.