- This article is about the Text to Speech block. For the looks block, see Say () (block).
|Category||Text to Speech|
The speak () block is a stack block and a Text to Speech block. The block uses the text to speech tool to speak the given text. It will speak the selected voice with the language selected in the Set Language to () block.
The block requires a connection to the internet in order to function unless the voice is set to "kitten", as the block uses the Amazon Polly API to speak.
Usage of the block is limited to 128 characters. If a string longer than 128 characters is given, then only the first 128 characters will be spoken.
In simple animations:
when green flag clicked broadcast (message 1 v) say [Hello] when I receive [message 1 v] speak [Hello]
A non-player character in an RPG:
when Green Flag clicked forever if <(distance to (player v)) < > then speak [hello there] wait until <not<(distance to (player v)) < >> end end
Speaking text in a different language:
when green flag clicked set language to (language::variables) speak (translate [Hello] to (language::variables))
Speaking text with a different voice:
when green flag clicked set voice to (giant v) speak [Hello]
Bad word detection
Similar to the Translate () to () block, a bad word detector is present. When a user attempts to input a bad word and clicks the block, no words will be spoken unless the voice is set to "kitten". Additionally, all bad English words will not said regardless of language, although bad words in other languages will only not be said when that language is chosen.