enableMicrophone method

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

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

Implementation

Future<int?> enableMicrophone(bool enable) async {
  $a() => ($instance as $p_a.IGameRoom).enableMicrophone(enable);
  $i() => ($instance as $p_i.ByteRTCGameRoom).enableMicrophone(enable);

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