Commands to use TTS monster
// Acknowledge the requestapi.twitch.sendChat("Loading available voices....."); // Get list of voicesconst voices = await api.integrations.tts_monster.voices(); await api.twitch.sendChat("Available voices: "); let voicesMessage = ""; for (const voice of voices) { // Send message if it gets too long if (voice.name.length + voicesMessage.length > 400) { await api.twitch.sendChat(voicesMessage); voicesMessage = ""; } if (voicesMessage.length > 0) voicesMessage += ", "; voicesMessage += voice.name;} // Send left over chunk of messagesif (voicesMessage.length > 0) { await api.twitch.sendChat(voicesMessage + ".");}
Send a TTS message
You should restrict this command or add a cooldown to prevent using up all your TTS monster tokens.
const message = ctx.message; // Acknowledge the requestapi.twitch.sendChat("Generating TTS message....."); // Generate the TTS messageconst urls = await api.integrations.tts_monster.generateParsed(message); // Play the TTS message soundsawait api.vtftk.playSoundSeq(urls.map((url) => ({ src: url, volume: 1}))); return `Playing TTS message: ${message}`;