android_enableMicrophone method

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

@platform android @detail api @author luomingkang @brief 加入游戏房间后,调用该接口开启或关闭麦克风。同房间其他用户会收到回调 OnAudioDeviceStateChanged{@link #IRTCEngineEventHandler#OnAudioDeviceStateChanged}。 @param enable 是否开启麦克风:
- true:开启麦克风,采集并发布音频流。 - false:默认设置。关闭麦克风并停止发布音频流。 @return - 0:接口调用成功。 - -3:接口调用失败。没有加入房间。 @note 不可与 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}');
  }
}