A Squiso egy ingyenes, hatékony automatizálási eszköz, amely lehetővé teszi a Twitch adatfolyam testreszabását egyszerű szkriptek segítségével.
Hogyan adhatunk visszhangeffektust egy generált TTS-üzenethez
Ez a példa egy MP3 Text-To-Speech hangfájlt hoz létre, majd az FFMPEG segítségével visszhanghatást ad hozzá, mielőtt a Twitch csatornapontokkal lejátszaná.
Szkript példa
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.*;
import com.squiso.sysinfo.*;
// 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);
        }
    }
}
    