setLocalVoicePitch method Null safety

Future<int> setLocalVoicePitch(
  1. double pitch
)

Set the voice pitch of a local speaker.
The method changes the voice pitch of the local speaker.

Note: *

  • After a call ends, the setting is reset to the default value 1.0. *
  • The method conflicts with [setAudioEffectPreset]. After you call this method, the preset voice beautifier effect will be removed. [pitch] the voice frequency. Valid values: 0.5 to 2.0. Smaller values have lower pitches. The default value is 1, which indicates that the pitch is not changed.

Implementation

Future<int> setLocalVoicePitch(double pitch) async {
  IntValue reply =
      await _api.setLocalVoicePitch(DoubleValue()..value = pitch);
  return reply.value ?? -1;
}