public interface IAudioEffectManager
Modifier and Type | Method and Description |
---|---|
double |
getEffectsVolume()
Gets the volume of the audio effects.
|
int |
pauseAllEffects()
Pauses playing all audio effects.
|
int |
pauseEffect(int soundId)
Pauses playing the specified audio effect.
|
int |
playEffect(int soundId,
java.lang.String filePath,
int loop,
double pitch,
double pan,
double gain)
Plays a specified audio effect.
|
int |
playEffect(int soundId,
java.lang.String filePath,
int loopCount,
double pitch,
double pan,
double gain,
boolean publish)
Plays a specified audio effect.
|
int |
playEffect(int soundId,
java.lang.String filePath,
int loopCount,
double pitch,
double pan,
double gain,
boolean publish,
int startPos)
Plays a specified audio effect.
|
int |
preloadEffect(int soundId,
java.lang.String filePath)
Preloads a specified audio effect.
|
int |
preloadEffect(int soundId,
java.lang.String filePath,
int startPos)
Preloads a specified audio effect.
|
int |
resumeAllEffects()
Resumes playing all audio effects.
|
int |
resumeEffect(int soundId)
Resumes playing the specific audio effect.
|
int |
setEffectsVolume(double volume)
Sets the volume of audio effects.
|
int |
setVolumeOfEffect(int soundId,
double volume)
Sets the volume of the specified audio effect.
|
int |
stopAllEffects()
Stops playing all audio effects.
|
int |
stopEffect(int soundId)
Stops playing the specific audio effect.
|
int |
unloadEffect(int soundId)
Releases the specific preloaded audio effect from the memory.
|
double getEffectsVolume()
int setEffectsVolume(double volume)
volume
- The volume of audio effects. The value ranges between 0.0 and 100.0 (default).int setVolumeOfEffect(int soundId, double volume)
soundId
- The ID of the audio effect.volume
- The volume of the specified audio effect. The value ranges between 0.0 and 100.0
(default).int playEffect(int soundId, java.lang.String filePath, int loop, double pitch, double pan, double gain)
soundId
- The ID of the audio effect.filePath
- The absolute path of the local audio effect file or the URL
of the online audio effect file. Supported audio formats: mp3, mp4, m4a, aac,
3gp, mkv and wav.loop
- The number of times the audio effect loops:
- `-1`: Play the audio effect in an indefinite loop until you call
or
.
- `0`: Play the audio effect once.
- `1`: Play the audio effect twice.pitch
- The pitch of the audio effect. The value ranges between 0.5 and 2.0.
The default value is `1.0` (original pitch). The lower the value, the lower the pitch.pan
- The spatial position of the audio effect. The value ranges between -1.0 and 1.0:
- `-1.0`: The audio effect shows on the left.
- `0.0`: The audio effect shows ahead.
- `1.0`: The audio effect shows on the right.gain
- The volume of the audio effect. The value ranges between 0.0 and 100.0.
The default value is `100` (original volume).The lower the value, the lower the
volume of the audio effect.int playEffect(int soundId, java.lang.String filePath, int loopCount, double pitch, double pan, double gain, boolean publish)
soundId
- The ID of the audio effect..filePath
- The absolute path of the local audio effect file or the URL
of the online audio effect file. Supported audio formats: mp3, mp4, m4a, aac,
3gp, mkv and wav.loopCount
- The number of times the audio effect loops:
- `-1`: Play the audio effect in an indefinite loop until you call
or
.
- `0`: Play the audio effect once.
- `1`: Play the audio effect twice.pitch
- The pitch of the audio effect. The value ranges between 0.5 and 2.0.
The default value is `1.0` (original pitch). The lower the value, the lower the pitch.pan
- The spatial position of the audio effect. The value ranges between -1.0
and 1.0:
- `-1.0`: The audio effect shows on the left.
- `0.0`: The audio effect shows ahead.
- `1.0`: The audio effect shows on the right.gain
- The volume of the audio effect. The value ranges between 0.0 and 100.0.
The default value is `100` (original volume).The lower the value, the lower
the volume of the audio effect.publish
- Sets whether to publish the specified audio effect to the remote
stream:
- True: Publish the audio effect to the remote.
- False: false: Do not publish the audio effect to the remote.int playEffect(int soundId, java.lang.String filePath, int loopCount, double pitch, double pan, double gain, boolean publish, int startPos)
preloadEffect
, you can call
this method to play the specified audio effect for all users in
the channel.
This method plays only one specified audio effect each time it is called.
To play multiple audio effects, call this method multiple times.soundId
- The ID of the audio effect.filePath
- The absolute path of the local audio effect file or the URL
of the online audio effect file. Supported audio formats: mp3, mp4, m4a, aac,
3gp, mkv and wav.loopCount
- The number of times the audio effect loops:
- `-1`: Play the audio effect in an indefinite loop until you call stopEffect
or stopAllEffects
.
- `0`: Play the audio effect once.
- `1`: Play the audio effect twice.pitch
- The pitch of the audio effect. The value ranges between 0.5 and 2.0.
The default value is 1.0 (original pitch). The lower the value, the lower the pitch.pan
- The spatial position of the audio effect. The value ranges between -1.0
and 1.0:
- `-1.0`: The audio effect shows on the left.
- `0.0`: The audio effect shows ahead.
- `1.0`: The audio effect shows on the right.gain
- The volume of the audio effect. The value ranges between 0.0 and 100.0.
The default value is 100 (original volume). The lower the value, the lower
the volume of the audio effect.publish
- Sets whether to publish the specified audio effect to the remote
stream:
- True: Publish the audio effect to the remote.
- False: false: Do not publish the audio effect to the remote.startPos
- The start positionint stopEffect(int soundId)
soundId
- The ID of the audio effect.int stopAllEffects()
int preloadEffect(int soundId, java.lang.String filePath)
soundId
- The ID of the audio effect.filePath
- The absolute path of the local audio effect file or the URL
of the online audio effect file. Supported audio formats: mp3, mp4, m4a, aac,
3gp, mkv and wav.int preloadEffect(int soundId, java.lang.String filePath, int startPos)
IAudioEffectManager##playEffect() playEffect
to play the
preloaded audio effect or call
IAudioEffectManager##playAllEffects() playAllEffects
to play all the preloaded audio
effects.soundId
- The ID of the audio effect.filePath
- The absolute path of the local audio effect file or the URLstartPos
- The start position
of the online audio effect file. Supported audio formats: mp3, mp4, m4a, aac,
3gp, mkv and wav.int unloadEffect(int soundId)
soundId
- The ID of the audio effect.int pauseEffect(int soundId)
soundId
- The ID of the audio effect.int pauseAllEffects()
int resumeEffect(int soundId)
soundId
- The ID of the audio effect.int resumeAllEffects()