Skip to content

Integrations

Types

TTSMonsterVoice

Represents a voice from TTS Monster

PropertyTypeDescription
voice_idstringUnique ID of the voice
namestringName of the voice
samplestringURL for a audio sample

Functions

voices

Function () => Promise<TTSMonsterVoice[]>

Requests a list of available TTSMonsterVoices from TTS Monster

const voices = await api.integrations.tts_monster.voices();
// ...Work with the voices

generate

Function (voice_id: string, message: string) => Promise<string>

Generate a TTS voice message using the provided voice. Returns the URL of the voice message

ArgumentTypeExampleDescription
voice_idstringID of the voice to use
messagestringMessage for the voice to say
const voice_id = "/* ID of the voice */";
const message = "This is a TTS message";
const url = await api.integrations.tts_monster.generate(voice_id, message);
// Play the sound using vtftk
await api.vtftk.playSound(url);

generateParsed

Function (message: string) => Promise<string[]>

Generate a TTS voice message by parsing a message, determines the voices using the (Voice) example message syntax. Returns a list of URLs

ArgumentTypeExampleDescription
messagestringMessage to parse and generated voices for
const message =
"(Name1) This is the message for Name1 (Name2) This is the message for Name2";
const urls = await api.integrations.tts_monster.generateParsed(message);
// Play the TTS message sounds
await api.vtftk.playSoundSeq(
urls.map((url) => ({
src: url,
volume: 1,
}))
);