enableSpatialAudio method
@detail api
@author majun.lvhiei
@brief Enable/disable spatial audio function.
@param enable Whether to enable spatial audio function:
- true:Enable
- false:Disable(Default setting)
@note You need to call updateSelfPosition{@link #ISpatialAudio#updateSelfPosition} as well to really enjoy the spatial audio effect.
Implementation
Future enableSpatialAudio(bool enable) async {
$a() => ($instance as $p_a.ISpatialAudio).enableSpatialAudio(enable);
$i() => ($instance as $p_i.ByteRTCSpatialAudio).enableSpatialAudio(enable);
if (Platform.isAndroid) {
return $a();
} else if (Platform.isIOS) {
return $i();
} else {
throw UnsupportedError(
'Not Support Platform ${Platform.operatingSystem}');
}
}