Skip to main content

Reaction

generate#

FieldTypeRequiredDefaultDescription
messagestringโœ”๏ธnoneYour message
langstringโŒundefinedIf empty, the language used is that of the default configuration
splitPunctstringโŒundefinedCharacter used to cut the sentences ,.?!;:
Return#

Return a Promise with base64 mp3.

Example#
const reaction = async (event) => {
await media.play(await moduleGoogleTts.generate('Hello world'));
}

getLang#

Return#

Return a Promise with lang string.

Example#
const reaction = async (event) => {
const lang = await moduleGoogleTts.getLang()
console.log(lang)
}

setLang#

FieldTypeRequiredDefaultDescription
langstringโœ”๏ธnoneYour new lang
Return#

Return a Promise with base64 mp3.

Example#
const reaction = async (event) => {
await moduleGoogleTts.setLang("ja-JP")
const lang = await moduleGoogleTts.getLang()
console.log(lang) // should be "ja-JP"
}