enableLocalAudio method

  1. @override
Future<void> enableLocalAudio(
  1. bool enabled
)

Enables/Disables the local audio capture.

The audio function is enabled by default. This method disables/re-enables the local audio function, that is, to stop or restart local audio capture and processing.

This method does not affect receiving or playing the remote audio streams, and enableLocalAudio(false) is applicable to scenarios where the user wants to receive remote audio streams without sending any audio stream to other users in the channel.

The SDK triggers the RtcEngineEventHandler.microphoneEnabled callback once the local audio function is disabled or re-enabled.

Note

Parameter enabled Sets whether to disable/re-enable the local audio function:

  • true: (Default) Re-enable the local audio function, that is, to start local audio capture and processing.
  • false: Disable the local audio function, that is, to stop local audio capture and processing.

Implementation

@override
Future<void> enableLocalAudio(bool enabled) {
  return _invokeMethod('enableLocalAudio', {'enabled': enabled});
}