enableAudioSend method
@detail api
@author luomingkang
@brief 加入游戏房间后,开始或停止发送音频流。调用此接口不影响音频采集。同房间其他用户会收到相应的回调。
@param enable 是否发送音频流:
- true:发送音频流。
- false:默认设置。停止发送音频流(不会关闭麦克风),即静音。
@return
- 0:表示参数检查通过,不代表打开麦克风会成功,比如房间不存在
- -3:接口调用失败。没有加入房间。
@note 不可与 EnableMicrophone{@link #IGameRoom#EnableMicrophone} 同时调用。
Implementation
Future<int?> enableAudioSend(bool enable) async {
$a() => ($instance as $p_a.IGameRoom).enableAudioSend(enable);
$i() => ($instance as $p_i.ByteRTCGameRoom).enableAudioSend(enable);
if (Platform.isAndroid) {
return $a();
} else if (Platform.isIOS) {
return $i();
} else {
throw UnsupportedError(
'Not Support Platform ${Platform.operatingSystem}');
}
}