setAudioEffectPreset method Null safety

Future<int> setAudioEffectPreset(
  1. int preset
)

Set a preset voice changer effect.
The method can add multiple preset audio effects to original human voices and change audio profiles.

Note:

  • You can call this method either before or after joining a room. By default, the audio effect is disabled after the call ends.
  • The method conflicts with [setLocalVoicePitch]. After you call this method, the voice pitch is reset to the default value 1.0. [preset] indicates the preset audio effect. By default, the sound effect is disabled. For more information, see [NERtcVoiceChangerType].

Implementation

Future<int> setAudioEffectPreset(int preset) async {
  IntValue reply =
      await _api.setAudioEffectPreset(IntValue()..value = preset);
  return reply.value ?? -1;
}