setAttenuationModel method

FutureOr<int> setAttenuationModel(
  1. ByteRTCAttenuationType type,
  2. float coefficient
)

@detail api @author huangshouqin @brief 设置范围语音的音量衰减模式。 @param type 音量衰减模式。默认为线性衰减。详见 ByteRTCAttenuationType{@link #ByteRTCAttenuationType}。 @param coefficient 指数衰减模式下的音量衰减系数,默认值为 1。范围 0.1,100,推荐设置为 50。数值越大,音量的衰减速度越快。 @return 调用是否成功
- 0:调用成功 - -1:调用失败。原因为在调用 enableRangeAudio:{@link #ByteRTCRangeAudio#enableRangeAudio} 开启范围语音前或进房前调用本接口 @note 音量衰减范围通过 updateReceiveRange:{@link #ByteRTCRangeAudio#updateReceiveRange} 进行设置。

Implementation

FutureOr<int> setAttenuationModel(
    ByteRTCAttenuationType type, float coefficient) async {
  return await nativeCall(
      'setAttenuationModel:coefficient:', [type.$value, coefficient]);
}