Integrations
Types
TTSMonsterVoice
Represents a voice from TTS Monster
Property | Type | Description |
---|---|---|
voice_id | string | Unique ID of the voice |
name | string | Name of the voice |
sample | string | URL 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
Argument | Type | Example | Description |
---|---|---|---|
voice_id | string | ID of the voice to use | |
message | string | Message 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 vtftkawait 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
Argument | Type | Example | Description |
---|---|---|---|
message | string | Message 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 soundsawait api.vtftk.playSoundSeq( urls.map((url) => ({ src: url, volume: 1, })));