Description
Adds a custom Text-to-Speech Finished trigger that fires when Speaker.bot is finished speaking.
Import Code
This plugin is for use with Streamer.bot 0.2.0-0.2.2, and Speaker.bot 0.1.1 ONLY. It will be deprecated once Streamer.bot 0.2.3 reaches Stable release as new interoperability between Streamer.bot 0.2.3 and Speaker.bot 0.1.2 includes similar functionality. Because Speaker.bot 0.1.2 made changes to the timing of when the audio file is saved, this trigger does not fire at the correct time when using that version.
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.