Squiso is a free, powerful automation tool that lets you customize your Twitch stream using simple scripts.
How to Periodically Make ChatGPT Comment Your Gameplay With TTS
This script example periodically takes a screenshot of your gameplay and then asks ChatGPT to generate a sassy comment about it which then is spoken with TTS in your Twitch stream.
Script Example
import com.squiso.*;
import com.squiso.exception.*;
import com.squiso.scripting.*;
import com.squiso.scripting.data.*;
import com.squiso.keyboard.*;
import com.squiso.twitch.*;
import com.squiso.datatypes.*;
import com.squiso.utils.*;
// Important - Please do not change the row below - otherwise you will get a compilation error!
public class Script_Example extends SquisoScript {
@Override
public void onEveryMinute(OnEveryMinuteData data, API api) throws SquisoException {
// Do this every 15 minutes
if (data.is(15)) {
// Take a screenshot of the desktop as a JPG
SquisoData screenshot = api.takeScreenshot(0, 0, 1920, 1080, "jpg");
// Save the screenshot to the disk as well (for fun)
screenshot.writeToFile("screenshot.jpg");
// Ask AI to comment on your gameplay
String prompt = "My name is Squiso and I am currently playing a game. Please make a funny but sassy comment about my gameplay. Please address me first.";
SquisoString comment = api.generateAIImageText(screenshot, "jpg", prompt);
// Play the comment as TTS
// All voices can be found here: https://www.squiso.com/voices/
String voiceID = "zto16fk0";
api.speak(voiceID, comment);
// Send chat message
api.sendTwitchChatMessage(comment);
}
}
}