setLocalVoicePitch method
@detail api
@author wangjunzheng
@brief 开启本地语音变调功能,多用于 K 歌场景。
使用该方法,你可以对本地语音的音调进行升调或降调等调整。
@param pitch 相对于语音原始音调的升高/降低值,取值范围-12,12,默认值为 0,即不做调整。
取值范围内每相邻两个值的音高距离相差半音,正值表示升调,负值表示降调,设置的绝对值越大表示音调升高或降低越多。
超出取值范围则设置失败,并且会触发 onWarning{@link #IRTCEngineEventHandler#onWarning} 回调,提示 WarningCode{@link #WarningCode} 错误码为 WARNING_CODE_SET_SCREEN_STREAM_INVALID_VOICE_PITCH 设置语音音调不合法
@return
- 0: 调用成功。
- < 0 : 调用失败。查看 ReturnStatus{@link #ReturnStatus} 获得更多错误说明
Implementation
Future<int?> setLocalVoicePitch(int pitch) async {
$a() => ($instance as $p_a.RTCEngine).setLocalVoicePitch(pitch);
$i() => ($instance as $p_i.ByteRTCEngine).setLocalVoicePitch(pitch);
if (Platform.isAndroid) {
return $a();
} else if (Platform.isIOS) {
return $i();
} else {
throw UnsupportedError(
'Not Support Platform ${Platform.operatingSystem}');
}
}