Sound effect parameter (disused)


new TRTCAudioEffectParam(effectId, path, loopCount, publish, volume)

"Sound effects" in TRTC refer to some short audio files (usually only a few seconds), such as "applause" and "laughter". This parameter is used to specify the path and number of playback times of a sound effect file (short audio file) in the sound effect playback API playAudioEffect on legacy versions. After v7.3, the sound effect API has been replaced by a new startPlayMusic API. When you specify the AudioMusicParam parameter of startPlayMusic, if isShortFile is set to true, the file is a "sound effect" file.

Name Type Description
effectId Number required

[Field description] sound effect ID
[Note] the SDK supports playing multiple sound effects. IDs are used to distinguish different sound effects and control their start, end, volume, etc.

path String required

[Field description] sound effect file path. Supported file formats include AAC, MP3, and M4A.

loopCount Number required

[Field description] number of times the sound effect is looped
[Recommended value] 0 or any positive integer. 0 (default) indicates that the sound effect is played once, 1 twice, and so on.

publish Boolean required

[Field description] whether the sound effect is upstreamed
[Recommended value] true: when the sound effect is played back locally, it will be upstreamed to the cloud and can be heard by remote users. false: the sound effect will not be upstreamed to the cloud and can only be heard locally. Default value: false

volume Number required

[Field description] sound effect volume
[Recommended value] value range: 0–100. Default value: 100