This article is about the Text to Speech block. For the looks block, see Say () (block).
Speak ()
speak ()
Category Text to Speech
Type Stack
Introduced in 3.0

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.

Limitations

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.[1]

Uses

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)) < [50]> then
        speak [hello there]
        wait until <not<(distance to (player v)) < [50]>>
    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.

See Also

References

Cookies help us deliver our services. By using our services, you agree to our use of cookies.