setAudioProfile method
@detail api
@author zhangyuanyuan.0101
@brief 设置音质档位。
当所选的 ChannelProfile{@link #ChannelProfile} 中的音频参数无法满足你的场景需求时,调用本接口切换的音质档位。
@param audioProfile 音质档位,参看 AudioProfileType{@link #AudioProfileType}
@return
- 0: 调用成功。
- < 0 : 调用失败。查看 ReturnStatus{@link #ReturnStatus} 获得更多错误说明
@note
- 该方法在进房前后均可调用;
- 支持通话过程中动态切换音质档位。
Implementation
Future<int?> setAudioProfile(AudioProfileType audioProfile) async {
$a() => ($instance as $p_a.RTCEngine)
.setAudioProfile(t_AudioProfileType.code_to_android(audioProfile));
$i() => ($instance as $p_i.ByteRTCEngine)
.setAudioProfile(t_AudioProfileType.code_to_ios(audioProfile));
if (Platform.isAndroid) {
return $a();
} else if (Platform.isIOS) {
return $i();
} else {
throw UnsupportedError(
'Not Support Platform ${Platform.operatingSystem}');
}
}