setPosition method
@detail api
@brief Sets the start position of the audio effect file.
@param effectId Audio effect ID
@param position The starting playback position of the audio effect file in milliseconds.
You can get the total duration of the audio effect file by calling getDuration{@link #IAudioEffectPlayer#getDuration}, the value of position should be less than the total duration of the audio effect file.
@return
- 0: Success.
- < 0 : Fail. See ReturnStatus{@link #ReturnStatus} for more details.
@note
- When playing online files, calling this API may cause a delay in playback.
- Call this API after start{@link #IAudioEffectPlayer#start}.
Implementation
Future<int?> setPosition(int effectId, int position) async {
$a() =>
($instance as $p_a.IAudioEffectPlayer).setPosition(effectId, position);
$i() => ($instance as $p_i.ByteRTCAudioEffectPlayer)
.setPosition(effectId, position);
if (Platform.isAndroid) {
return $a();
} else if (Platform.isIOS) {
return $i();
} else {
throw UnsupportedError(
'Not Support Platform ${Platform.operatingSystem}');
}
}