enableRangeAudio method
@detail api
@author chuzhongtao
@brief Enable/disable the range audio function.
Range audio means that within a certain range in a same RTC room, the audio volume of the remote user received by the local user will be amplified/attenuated as the remote user moves closer/away. The audio coming from out of the range cannot be heard. See updateReceiveRange{@link #IRangeAudio#updateReceiveRange} to set audio receiving range.
@param enable Whether to enable audio range function:
- true: Enable
- false: Disable(Defaulting setting)
@note You can call this API anytime before or after entering a room. To ensure a smooth switch to the range audio mode after entering the room, you need to call updatePosition{@link #IRangeAudio#updatePosition} before this API to set your own position coordinates, and then enable the range audio function.
Implementation
Future enableRangeAudio(bool enable) async {
$a() => ($instance as $p_a.IRangeAudio).enableRangeAudio(enable);
$i() => ($instance as $p_i.ByteRTCRangeAudio).enableRangeAudio(enable);
if (Platform.isAndroid) {
return $a();
} else if (Platform.isIOS) {
return $i();
} else {
throw UnsupportedError(
'Not Support Platform ${Platform.operatingSystem}');
}
}