setAttenuationModel method
@detail api
@author huangshouqin
@brief Set the volume roll-off mode that a 3D sound has in an audio source when using the Range Audio feature.
@param type Volume roll-off mode. It is linear roll-off mode by default. Refer to AttenuationType{@link #AttenuationType} 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 #IRangeAudio#enableRangeAudio}.
@note Call updateReceiveRange{@link #IRangeAudio#updateReceiveRange} to set the range outside which the volume of the sound does not attenuate.
Implementation
FutureOr<int> setAttenuationModel(
AttenuationType type, float coefficient) async {
return await nativeCall('setAttenuationModel', [type.$value, coefficient]);
}