Squiso je bezplatný, výkonný automatizačný nástroj, ktorý vám umožňuje prispôsobiť si stream Twitch pomocou jednoduchých skriptov.

Ako pridať efekt ozveny do vygenerovanej správy TTS

Tento príklad vygeneruje zvukový súbor MP3 Text-To-Speech a potom použije FFMPEG na pridanie efektu ozveny pred jeho prehraním s Twitch Channel Points.

Príklad skriptu

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 onTwitchChannelPointRedeem(OnTwitchChannelPointRedeemData data, API api) throws SquisoException { // If the channel point reward is "Echo Brian" if (data.getRewardName().equals("Echo Brian")) { // Generate a TTS audio using the Brian voice // All voices can be found here: https://www.squiso.com/voices/ SquisoData tts = api.generateTTS("ggw6pyfz", data.getRedeemText()); // Generate a random ID that we will use through-out the script String randomID = StringUtil.getRandomAlphaNumericString(8); // Create a filename for the generated TTS String file = randomID + ".mp3"; // Save the TTS audio to the disk api.writeFile(file, tts); // Log that we saved the generated TTS api.log("Saved generated TTS to \"" + file + "\"."); // Create a new filename for the echo version String fileEcho = randomID + "_echo.mp3"; // Add an echo effect to the audio file using FFMPEG // This requires that you have downloaded and added ffmpeg.exe and added it in the Squiso folder // FFMPEG is a free audio tool that can do a lot of audio manipulation String command = "ffmpeg.exe -i " + file + " -filter_complex \"aecho=0.8:0.9:500|1000:0.2|0.1\" " + fileEcho; api.exec(command); // Play the echo version api.playAudio(fileEcho); } } }