setAudioEffectParameters abstract method
- required AudioEffectPreset preset,
- required int param1,
- required int param2,
Sets the parameters for SDK preset voice effects.
You can call this method to configure the following settings for the local user who is sending the stream: 3D voice effect: Set the surround cycle of the 3D voice effect. Pitch correction effect: Set the base scale and main pitch of the pitch correction effect. To allow users to adjust the pitch correction effect themselves, it is recommended to bind the base scale and main pitch configuration options to the UI elements of your app. After setting, all users in the channel can hear the effect. To achieve better voice effects, it is recommended that you perform the following operations before calling this method: Call setAudioScenario to set the audio scenario to high-quality, i.e., audioScenarioGameStreaming (3). Call setAudioProfile to set the profile to audioProfileMusicHighQuality (4) or audioProfileMusicHighQualityStereo (5). This method can be called before and after joining a channel. Do not set the profile parameter of setAudioProfile to audioProfileSpeechStandard (1) or audioProfileIot (6), otherwise this method will not take effect. This method provides the best processing effect for voice. It is not recommended to use this method to process audio data that contains music. After calling setAudioEffectParameters, it is not recommended to call the following methods, otherwise the effect set by setAudioEffectParameters will be overridden: setAudioEffectPreset setVoiceBeautifierPreset setLocalVoicePitch setLocalVoiceEqualization setLocalVoiceReverb setVoiceBeautifierParameters setVoiceConversionPreset This method depends on the voice beautifier dynamic library libagora_audio_beauty_extension.dll. Deleting this library will cause the feature to not function properly.
presetSDK preset effects. The following settings are supported: roomAcoustics3dVoice, 3D voice effect. Before using this enum, you need to set the profile parameter of setAudioProfile to audioProfileMusicStandardStereo (3) or audioProfileMusicHighQualityStereo (5), otherwise this enum setting is invalid. After enabling 3D voice, users need to use audio playback devices that support stereo to hear the expected effect. pitchCorrection, pitch correction effect.param1If preset is set to roomAcoustics3dVoice, then param1 indicates the surround cycle of the 3D voice effect. The range is1,60in seconds. The default value is 10, meaning the voice surrounds 360 degrees in 10 seconds. If preset is set to pitchCorrection, then param1 indicates the base scale of the pitch correction effect: 1 : (Default) Natural major. 2 : Natural minor. 3 : Japanese scale.param2If preset is set to roomAcoustics3dVoice, you need to set param2 to 0. If preset is set to pitchCorrection, then param2 indicates the main pitch of the pitch correction effect: 1 : A 2 : A# 3 : B 4 : (Default) C 5 : C# 6 : D 7 : D# 8 : E 9 : F 10 : F# 11 : G 12 : G#
Returns When the method call succeeds, there is no return value; when fails, the AgoraRtcException exception is thrown. You need to catch the exception and handle it accordingly. See Error Codes for details and resolution suggestions.
Implementation
Future<void> setAudioEffectParameters(
{required AudioEffectPreset preset,
required int param1,
required int param2});