Skip to main content

Overlay Effects

Overlay Media

Use effects to play media in connected overlay widgets.

Play GIF overlay

Plays a GIF in connected overlay widgets.

Play a GIFAdvanced Script
effects.gif("https://files.kicklet.app/the-file.gif", { duration: 5 });

API reference

effects.gif

effects.gif(url, options?)
Input
url
string

GIF URL or uploaded file URL.

optionsoptional
object

Playback options.

durationoptional
number

Playback duration in seconds.

Output
void

The overlay effect is queued as a side effect.

Play sound overlay

Plays a sound in connected overlay widgets.

Play a soundAdvanced Script
effects.sound("https://files.kicklet.app/the-file.mp3", { duration: 5, volume: 10 });

API reference

effects.sound

effects.sound(url, options?)
Input
url
string

Audio URL or uploaded file URL.

optionsoptional
object

Playback options.

durationoptional
number

Playback duration in seconds.

volumeoptional
number

Playback volume.

Output
void

The overlay effect is queued as a side effect.

Play sound and GIF overlay

Plays a sound and GIF together in connected overlay widgets.

Play sound and GIFAdvanced Script
effects.soundGif(
"https://files.kicklet.app/the-sound.mp3",
"https://files.kicklet.app/the-gif.gif",
{
duration: 5,
volume: 10,
},
);

API reference

effects.soundGif

effects.soundGif(soundUrl, gifUrl, options?)
Input
soundUrl
string

Audio URL or uploaded file URL.

gifUrl
string

GIF URL or uploaded file URL.

optionsoptional
object

Playback options.

durationoptional
number

Playback duration in seconds.

volumeoptional
number

Playback volume.

Output
void

The overlay effect is queued as a side effect.

Press CTRL + I in the Advanced Editor to open the asset picker for uploaded files.

Custom Overlay Events

Custom events send JSON-serializable data to overlay widgets.

Send custom overlay event

Sends a custom JSON-serializable event to connected overlay widgets.

Custom eventAdvanced Script
events.custom("shop-effect", {
viewer: sender.username,
item: "confetti",
});

API reference

events.custom

events.custom(name, payload?)
Input
name
string

Custom event name.

payloadoptional
objectarraystringnumberbooleannull

Event payload available to overlay code.

Output
void

The custom event is queued as a side effect.

Text-to-Speech

Use TTS effects when a connected overlay should speak a message.

Play text to speech

Speaks text in connected overlay widgets with the selected voice.

Text-to-speechAdvanced Script
effects.tts("en_US-amy-medium", "Hello, this is a test message.");

API reference

effects.tts

effects.tts(voiceId, text)
Input
voiceId
string

Voice ID such as en_US-amy-medium.

text
string

Text to speak.

Output
void

The text-to-speech effect is queued as a side effect.

Async overlay wrappers

Async wrapper for effects.gif(url, options?).

API reference

async.effects.gif

async.effects.gif(url, options?)
Input
url
string

GIF URL or uploaded file URL.

optionsoptional
object

Playback options.

durationoptional
number

Playback duration in seconds.

Output
void

The overlay effect is queued as a side effect.

Async wrapper for effects.sound(url, options?).

API reference

async.effects.sound

async.effects.sound(url, options?)
Input
url
string

Audio URL or uploaded file URL.

optionsoptional
object

Playback options.

durationoptional
number

Playback duration in seconds.

volumeoptional
number

Playback volume.

Output
void

The overlay effect is queued as a side effect.

Async wrapper for effects.soundGif(soundUrl, gifUrl, options?).

API reference

async.effects.soundGif

async.effects.soundGif(soundUrl, gifUrl, options?)
Input
soundUrl
string

Audio URL or uploaded file URL.

gifUrl
string

GIF URL or uploaded file URL.

optionsoptional
object

Playback options.

durationoptional
number

Playback duration in seconds.

volumeoptional
number

Playback volume.

Output
void

The overlay effect is queued as a side effect.

Async wrapper for effects.tts(voiceId, text).

API reference

async.effects.tts

async.effects.tts(voiceId, text)
Input
voiceId
string

Voice ID such as en_US-amy-medium.

text
string

Text to speak.

Output
void

The text-to-speech effect is queued as a side effect.

Async wrapper for events.custom(name, payload?).

API reference

async.events.custom

async.events.custom(name, payload?)
Input
name
string

Custom event name.

payloadoptional
objectarraystringnumberbooleannull

Event payload available to overlay code.

Output
void

The custom event is queued as a side effect.

Available voice IDs:

idnamegender
en_GB-alan-mediumAlanM
en_GB-alba-mediumAlbaF
en_GB-aru-mediumAruM
en_GB-cori-highCoriF
en_GB-jenny_dioco-mediumJenny_diocoF
en_GB-northern_english_male-mediumNorthern_english_maleM
en_GB-semaine-mediumSemaineF
en_GB-southern_english_female-lowSouthern_english_femaleF
en_GB-vctk-mediumVctkF
en_US-amy-mediumAmyF
en_US-arctic-mediumArcticM
en_US-bryce-mediumBryceM
en_US-danny-lowDannyM
en_US-hfc_female-mediumHfc_femaleF
en_US-hfc_male-mediumHfc_maleM
en_US-joe-mediumJoeM
en_US-john-mediumJohnM
en_US-kathleen-lowKathleenF
en_US-kristin-mediumKristinF
en_US-kusal-mediumKusalM
en_US-l2arctic-mediumL2arcticM
en_US-lessac-highLessacF
en_US-libritts-highLibrittsF
en_US-libritts_r-mediumLibritts_rF
en_US-ljspeech-highLjspeechF
en_US-norman-mediumNormanM
en_US-ryan-highRyanM