enableLocalAudio abstract method

Future<void> enableLocalAudio(
  1. bool enabled
)

Enables or disables local audio capture.

When a user joins a channel, the audio function is enabled by default. This method can disable or re-enable the local audio function, that is, stop or restart local audio capture. The difference between this method and muteLocalAudioStream is: enableLocalAudio : Enables or disables local audio capture and processing. Using enableLocalAudio to disable or enable local capture will cause a brief interruption in hearing remote playback locally. muteLocalAudioStream : Stops or resumes sending the local audio stream without affecting the capture status.

  • enabled true : Re-enables the local audio function, i.e., enables local audio capture (default); false : Disables the local audio function, i.e., stops local audio capture.

Returns When the method call succeeds, there is no return value; when fails, the AgoraRtcException exception is thrown. You need to catch the exception and handle it accordingly. See Error Codes for details and resolution suggestions.

Implementation

Future<void> enableLocalAudio(bool enabled);