getDuration method

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

@detail api @brief Get the duration of the audio effect file. @param effectId Audio effect ID @return - >0: Success, the duration of the audio effect file in milliseconds. - < 0: failed. @note Call this API after start{@link #IAudioEffectPlayer#start}.

Implementation

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

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