setPlaybackSpeed method
@detail api
@brief Set the playback speed of the audio file.
@param speed The ratio of the actual playback speed than that of the original speed of the audio file in %. The range is [50,200]. The default value is 100.
@return
- 0: Success.
- < 0 : Fail. See ReturnStatus{@link #ReturnStatus} for more details.
@note
- Call this API only when audio is mixing.
- The API is valid for audio file and not PCM data.
Implementation
Future<int?> setPlaybackSpeed(int speed) async {
$a() => ($instance as $p_a.IMediaPlayer).setPlaybackSpeed(speed);
$i() => ($instance as $p_i.ByteRTCMediaPlayer).setPlaybackSpeed(speed);
if (Platform.isAndroid) {
return $a();
} else if (Platform.isIOS) {
return $i();
} else {
throw UnsupportedError(
'Not Support Platform ${Platform.operatingSystem}');
}
}