setAudioPitch method
@detail api
@brief Set the pitch of the local audio file mixing. Usually used in karaoke scenes.
@param pitch The increase or decrease value compared with the original pitch of the music file. The range is [-12, 12]. The default value is 0. The pitch distance between two adjacent values is half a step. A positive value indicates a rising pitch, and a negative value indicates a falling pitch.
@return
- 0: Success.
- < 0 : Fail. See ReturnStatus{@link #ReturnStatus} for more details.
@note
- Call this API only when audio is mixing.
- Support audio file only and not PCM data.
Implementation
Future<int?> setAudioPitch(int pitch) async {
$a() => ($instance as $p_a.IMediaPlayer).setAudioPitch(pitch);
$i() => ($instance as $p_i.ByteRTCMediaPlayer).setAudioPitch(pitch);
if (Platform.isAndroid) {
return $a();
} else if (Platform.isIOS) {
return $i();
} else {
throw UnsupportedError(
'Not Support Platform ${Platform.operatingSystem}');
}
}