Squiso este un instrument de automatizare gratuit și puternic, care vă permite să vă personalizați fluxul Twitch folosind scripturi simple.

Cum să adăugați un efect de ecou la un mesaj TTS generat

Acest exemplu generează un fișier audio MP3 Text-To-Speech și apoi utilizează FFMPEG pentru a adăuga un efect de ecou înainte de a-l reda cu Twitch Channel Points.

Exemplu de script

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); } } }