setAttenuationModel abstract method

Future<int?> setAttenuationModel({
  1. required AttenuationType type,
  2. required double coefficient,
})

Set the volume attenuation mode of the range audio.

type: Volume attenuation mode, the default is linear attenuation.

coefficient: Volume attenuation factor in exponential attenuation mode. The default value is 1.
The value range is [0.1,100]. It is recommended to set this value to 50.
The higher the value, the faster the attenuation of the volume.

API call result:

  • 0: Success.
  • -1: Failure, because you called this API before calling RTCRangeAudio.enableRangeAudio to enable range audio or before entering the room.

Notes: Set the volume attenuation range with RTCRangeAudio.updateReceiveRange.

Implementation

Future<int?> setAttenuationModel({
  required AttenuationType type,
  required double coefficient,
});