onLocalAudioStateChanged property

void Function(RtcConnection connection, LocalAudioStreamState state, LocalAudioStreamReason reason)? onLocalAudioStateChanged
final

Callback when the local audio state changes.

When the local audio state changes (including microphone capture and audio encoding states), the SDK triggers this callback to report the current local audio state. This callback helps you diagnose issues by providing the current state and reason when a local audio failure occurs. When the state is localAudioStreamStateFailed (3), you can check the returned error information in the error parameter.

  • connection Connection information. See RtcConnection.
  • state Current local audio state. See LocalAudioStreamState.
  • reason Reason for the local audio state change. See LocalAudioStreamReason.

Implementation

final void Function(RtcConnection connection, LocalAudioStreamState state,
    LocalAudioStreamReason reason)? onLocalAudioStateChanged;