Public Member Functions | |
double | getEffectsVolume () |
int | setEffectsVolume (double volume) |
int | setVolumeOfEffect (int soundId, double volume) |
int | playEffect (int soundId, String filePath, int loop, double pitch, double pan, double gain) |
int | playEffect (int soundId, String filePath, int loopCount, double pitch, double pan, double gain, boolean publish) |
int | stopEffect (int soundId) |
int | stopAllEffects () |
int | preloadEffect (int soundId, String filePath) |
int | unloadEffect (int soundId) |
int | pauseEffect (int soundId) |
int | pauseAllEffects () |
int | resumeEffect (int soundId) |
int | resumeAllEffects () |
Provides the methods to manage the audio effects.
double io.agora.rtc.IAudioEffectManager.getEffectsVolume | ( | ) |
Gets the volume of the audio effects.
The value ranges between 0.0 and 100.0.
int io.agora.rtc.IAudioEffectManager.pauseAllEffects | ( | ) |
Pauses all audio effects.
int io.agora.rtc.IAudioEffectManager.pauseEffect | ( | int | soundId | ) |
Pauses a specified audio effect.
soundId | ID of the audio effect. Each audio effect has a unique ID. |
int io.agora.rtc.IAudioEffectManager.playEffect | ( | int | soundId, |
String | filePath, | ||
int | loop, | ||
double | pitch, | ||
double | pan, | ||
double | gain | ||
) |
Plays a specified audio effect.
soundId | ID of the specified audio effect. Each audio effect has a unique ID. If the audio effect is preloaded into the memory through the preloadEffect method, ensure that the soundID value is set to the same value as in the preloadEffect method. |
filePath | Absolute file path of the audio effect file. |
loop | Sets the number of times the audio effect loops:
|
pitch | Pitch of the audio effect. The value ranges between 0.5 and 2. The default value is 1 (no change to the pitch). The lower the value, the lower the pitch. |
pan | Spatial position of the audio effect. The value ranges between -1.0 and 1.0.
|
gain | Volume of the audio effect. The value ranges betwwen 0.0 and 100,0. The default value is 100.0. The lower the value, the lower the volume of the audio effect. |
int io.agora.rtc.IAudioEffectManager.playEffect | ( | int | soundId, |
String | filePath, | ||
int | loopCount, | ||
double | pitch, | ||
double | pan, | ||
double | gain, | ||
boolean | publish | ||
) |
Plays a specified local or online audio effect file.
With this method, you can set the loop count, pitch, pan, and gain of the audio effect file and whether the remote user can hear the audio effect.
To play multiple audio effect files simultaneously, call this method multiple times with different soundIds and filePaths. We recommend playing no more than three audio effect files at the same time.
When the audio effect file playback is finished, the SDK triggers the onAudioEffectFinished callback.
soundId | ID of the specified audio effect. Each audio effect has a unique ID. If you preloaded the audio effect into the memory through the preloadEffect method, ensure that the soundID value is set to the same value as in the preloadEffect method. |
filePath | The absolute file path (including the suffixes of the filename) of the audio effect file or the URL of the online audio effect file. For example, /sdcard/emulated/0/audio.mp4 . Supported audio formats: mp3, mp4, m4a, aac. 3gp, mkv, and wav. |
loopCount | Sets the number of times the audio effect loops:
|
pitch | Sets the pitch of the audio effect. The value ranges between 0.5 and 2. The default value is 1 (no change to the pitch). The lower the value, the lower the pitch. |
pan | Sets the spatial position of the audio effect. The value ranges between -1.0 and 1.0.
|
gain | Sets the volume of the audio effect. The value ranges between 0.0 and 100,0. The default value is 100.0. The lower the value, the lower the volume of the audio effect. |
publish | Set whether or not to publish the specified audio effect to the remote stream:
|
int io.agora.rtc.IAudioEffectManager.preloadEffect | ( | int | soundId, |
String | filePath | ||
) |
Preloads a specified audio effect file into the memory.
Supported audio formats: mp3, aac, m4a, 3gp, wav.
soundId | ID of the audio effect. Each audio effect has a unique ID. |
filePath | Absolute path of the audio effect file. |
int io.agora.rtc.IAudioEffectManager.resumeAllEffects | ( | ) |
Resumes playing all audio effects.
int io.agora.rtc.IAudioEffectManager.resumeEffect | ( | int | soundId | ) |
Resumes playing a specified audio effect.
soundId | ID of the audio effect. Each audio effect has a unique ID. |
int io.agora.rtc.IAudioEffectManager.setEffectsVolume | ( | double | volume | ) |
Sets the volume of the audio effects.
volume | Volume of the audio effects. The value ranges between 0.0 and 100.0 (default). |
int io.agora.rtc.IAudioEffectManager.setVolumeOfEffect | ( | int | soundId, |
double | volume | ||
) |
Sets the volume of a specified audio effect.
soundId | ID of the audio effect. Each audio effect has a unique ID. |
volume | Volume of the audio effect. The value ranges between 0.0 and 100.0 (default). |
int io.agora.rtc.IAudioEffectManager.stopAllEffects | ( | ) |
Stops playing all audio effects.
int io.agora.rtc.IAudioEffectManager.stopEffect | ( | int | soundId | ) |
Stops playing a specified audio effect.
soundId | ID of the specified audio effect. Each audio effect has a unique ID. |
soundID
value is set to the same value as in the preloadEffect method. int io.agora.rtc.IAudioEffectManager.unloadEffect | ( | int | soundId | ) |
Releases a specified preloaded audio effect from the memory.
soundId | ID of the audio effect. Each audio effect has a unique ID. |