setLocalVoicePitch method
@detail api
@author wangjunzheng
@brief Change local voice to a different key, mostly used in Karaoke scenarios.
You can adjust the pitch of local voice such as ascending or descending with this method.
@param pitch The value that is higher or lower than the original local voice within a range from -12 to 12. The default value is 0, i.e. No adjustment is made.
The difference in pitch between two adjacent values within the value range is a semitone, with positive values indicating an ascending tone and negative values indicating a descending tone, and the larger the absolute value set, the more the pitch is raised or lowered.
Out of the value range, the setting fails and triggers onWarning{@link #IRTCEngineEventHandler#onWarning} callback, indicating WARNING_CODE_SET_SCREEN_STREAM_INVALID_VOICE_PITCH for invalid value setting with WarningCode{@link #WarningCode}.
@return
- 0: Success.
- < 0 : Fail. See ReturnStatus{@link #ReturnStatus} for more details
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}');
}
}