enableMicrophone method
@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?> 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}');
}
}