getVolume method

Future<int?> getVolume(
  1. int effectId
)

@detail api @brief 获取当前音量。 @param effectId 音效 ID @return - >0: 成功, 当前音量值。 - < 0: 失败 @note 仅在调用 start{@link #IAudioEffectPlayer#start} 后调用此接口。

Implementation

Future<int?> getVolume(int effectId) async {
  $a() => ($instance as $p_a.IAudioEffectPlayer).getVolume(effectId);
  $i() => ($instance as $p_i.ByteRTCAudioEffectPlayer).getVolume(effectId);

  if (Platform.isAndroid) {
    return $a();
  } else if (Platform.isIOS) {
    return $i();
  } else {
    throw UnsupportedError(
        'Not Support Platform ${Platform.operatingSystem}');
  }
}