Skip to content

Reference Script Functions Speech

Kristopher Barrantes edited this page Nov 5, 2026 · 2 revisions

Speech script functions

Also on the Cuebot Docs site.

Functions for C# (Cb.Call) and Python (a cb method each, or cb.call). See Script functions for how to use them.

A Run Python code step in the action editor

speech.activateVoiceGate

Switches to a VoiceGate profile. VoiceGate holds speech back while you are talking. Use "none" (or empty) to switch VoiceGate off.

Value In Python What to put in
profile profile The profile name as set on the Speech page, like "Talking". "none" switches it off.

Gives back: true when it worked, false when no profile has that name.

C#

var answer = await Cb.Call("speech.activateVoiceGate", new { profile = "Talking" });

Python

answer = cb.speech_activate_voice_gate(profile="Talking")

speech.clear

Throws away every text that is waiting in the speech queue. The text being spoken right now keeps playing.

Gives back: Nothing.

C#

var answer = await Cb.Call("speech.clear");

Python

answer = cb.speech_clear()

speech.pause

Pauses the speech queue, or starts it again. Texts keep waiting while it is paused.

Value In Python What to put in
paused paused Optional. true pauses, false starts it again. Default true.

Gives back: Nothing.

C#

var answer = await Cb.Call("speech.pause", new { paused = true });

Python

answer = cb.speech_pause(paused=True)

speech.setEnabled

Turns all text-to-speech on or off. While it is off, new texts are not spoken.

Value In Python What to put in
enabled enabled Optional. true turns speech on, false turns it off. Default true.

Gives back: Nothing.

C#

var answer = await Cb.Call("speech.setEnabled", new { enabled = false });

Python

answer = cb.speech_set_enabled(enabled=False)

speech.setEvents

Turns spoken event alerts (like follows and raids) on or off.

Value In Python What to put in
enabled enabled Optional. true turns event speech on, false turns it off. Default true.

Gives back: Nothing.

C#

var answer = await Cb.Call("speech.setEvents", new { enabled = true });

Python

answer = cb.speech_set_events(enabled=True)

speech.setUserVoice

Gives a viewer their own voice. Their chat messages are then read with it. An empty alias resets them to the normal voice.

Value In Python What to put in
platform platform The platform of the viewer, like "twitch".
user user Optional. The viewer's name, like "CoolViewer". Give this, the user id, or both.
userId user_id Optional. The viewer's user id. You can give this, the name, or both.
alias alias The voice name (alias) from the Speech page, like "Robot". Empty resets the voice.

Gives back: Nothing.

C#

var answer = await Cb.Call("speech.setUserVoice", new { platform = "twitch", user = "CoolViewer", alias = "Robot" });

Python

answer = cb.speech_set_user_voice(platform="twitch", user="CoolViewer", alias="Robot")

speech.speak

Says text out loud with your text-to-speech voice. It joins the speech queue. Nothing is said when speech is turned off or the text is empty.

Value In Python What to put in
text text What to say, like "Welcome to the stream!"
alias alias Optional. The voice name (alias) to use, as set on the Speech page. Leave it out for your default voice.
wait wait Optional. true waits until the text has been spoken before your script goes on. Default false.
silent silent Optional. true only makes the sound file and does not play it. Default false.
badWordFilter bad_word_filter Optional. true runs the text through your speech word filters first. Default false.

Gives back: Nothing, unless wait or silent is true. Then it gives back success (false when skipped or speech is off), duration in milliseconds, and speechFile (the saved sound file, or empty).

C#

var answer = await Cb.Call("speech.speak", new { text = "Welcome to the stream!" });

Python

answer = cb.speech_speak(text="Welcome to the stream!")

speech.state

Tells you what text-to-speech is doing right now.

Gives back: enabled, paused, eventsEnabled (true/false), queueLength (how many texts wait), current (the text being spoken, or empty) and voiceGate (true while VoiceGate holds speech back).

C#

var answer = await Cb.Call("speech.state");

Python

answer = cb.speech_state()

speech.stop

Stops the text that is being spoken right now. The queue goes on with the next one.

Gives back: Nothing.

C#

var answer = await Cb.Call("speech.stop");

Python

answer = cb.speech_stop()

speech.stopUser

Throws away a viewer's waiting texts and stops theirs if it is playing right now.

Value In Python What to put in
platform platform The platform of the viewer, like "twitch".
user user Optional. The viewer's name, like "SpammyViewer". Give this, the user id, or both.
userId user_id Optional. The viewer's user id. You can give this, the name, or both.

Gives back: How many texts were stopped or thrown away (0 when no name or id was given).

C#

var answer = await Cb.Call("speech.stopUser", new { platform = "twitch", user = "SpammyViewer" });

Python

answer = cb.speech_stop_user(platform="twitch", user="SpammyViewer")

Clone this wiki locally