Description
Adds a custom Text-to-Speech Finished trigger that fires when Speaker.bot is finished speaking.
Import Code
Speaker.bot TTS Finished Trigger by Sinistral2099.sb (1.9 KB)
Installation
- In Streamer.bot click on
Import
- Drag the Import File into
Import String
.
- Once the code is imported, make sure the
Execute Code
Sub Actions compile for both Actions.
Configuration
Speaker.bot
- In Speaker.bot, go to
Settings
. - If you are not already on it, go to the
General
tab. - Enable
Save TTS audio to file
. - Choose a directory for the files to be saved to.
Streamer.bot
- Next, go to the Speaker.bot TTS Finished Trigger Action, and double click on the
File Watcher
trigger. - Click the
Create New Trigger
button.
- Choose the folder that you chose to save the TTS audio files to in Speaker.bot.
- Change the filter text to “*.wav” and click OK.
- The new File Watcher should now be selected. If so, click OK.
- Done.
If the directory that you chose in Speaker.bot and the directory that you chose in the Streamer.bot File Watcher do not match, this trigger will not work.
How It Works
Speaker.bot only creates the WAV file after it is finished speaking the voice, so this extension watches for the creation of that file, activates the Trigger, and then deletes the WAV file.
The new Trigger can be found under Custom → Speaker.bot → Text-to-Speech Finished.
Now you can trigger Actions when Speaker.bot is finished speaking, rather than rely on an estimated delay calculation.