android_enableMicrophone method

Future<int?> android_enableMicrophone(
  1. bool enable
)

@platform android @detail api @author luomingkang @brief Turns on/off the microphone after joining a game room. Other users in the same room will receive callback OnAudioDeviceStateChanged{@link #IRTCEngineEventHandler#OnAudioDeviceStateChanged}. @param enable Whether to turn on the microphone:
- true: Turns on the microphone, captures and publishes audio stream. - false: Default setting. Turns off the microphone and stops capturing and publishing audio streams. @return - 0: Success. - -3: Failure. Not joined the room. @note Cannot be called simultaneously with enableAudioSend{@link #IGameRoom#enableAudioSend}.

Implementation

Future<int?> android_enableMicrophone(bool enable) async {
  $() => ($instance as $p_a.RTCRoom).enableMicrophone(enable);

  if (Platform.isAndroid) {
    return $();
  } else {
    throw UnsupportedError(
        'Not Support Platform ${Platform.operatingSystem}');
  }
}