setAudioPitch method
@detail api
@brief 开启变调功能,多用于 K 歌场景。
@param pitch 与音乐文件原始音调相比的升高/降低值,取值范围为 [-12,12],默认值为 0。每相邻两个值的音高距离相差半音,正值表示升调,负值表示降调。
@return
- 0: 调用成功。
- < 0 : 调用失败。查看 ReturnStatus{@link #ReturnStatus} 获得更多错误说明
@note
- 如果在起播前调用此接口,设置的参数值将被缓存,在起播后生效。
- 仅支持音乐文件混音,不支持 PCM 数据。
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}');
}
}