setAttenuationModel method
@detail api
@author huangshouqin
@brief Set the volume attenuation mode of the range audio.
@param type Volume roll-off mode. It is linear roll-off mode by default. Refer to ByteRTCAttenuationType{@link #ByteRTCAttenuationType} for more details.
@param coefficient Coefficient for the exponential roll-off mode. The default value is 1. It ranges 0.1,100. We recommended to set it to 50. The volume roll-off speed gets faster as this value increases.
@return Result of the call
- 0: Success
- -1: Failure because of calling this API before the user has joined a room or before enabling the Range Audio feature by calling enableRangeAudio:{@link #ByteRTCRangeAudio#enableRangeAudio}.
@note Call updateReceiveRange:{@link #ByteRTCRangeAudio#updateReceiveRange} to set the range outside which the volume of the sound does not attenuate.
Implementation
FutureOr<int> setAttenuationModel(
ByteRTCAttenuationType type, float coefficient) async {
return await nativeCall(
'setAttenuationModel:coefficient:', [type.$value, coefficient]);
}