我为 twitch 创建了一个运行良好的 tts 机器人,但每次任何消息接近在一起时,它都会试图同时说出它们,它只变成了噪音。有人知道如何解决这个问题吗?
var tmi = require('tmi.js');
var say = require('say');
//BOT CONNECTION OPTIONS
var options = {
options: {
debug: false
},
connection: {
cluster: "as",
reconnect: true
},
identity: {
username: "",
password: ""
},
channels: [""]
};
var client = new tmi.client(options);
client.connect();
client.on("chat", function (channel, userstate, message, self) {
say.speak(userstate.username + " says " + message);
});
试试这个: 跳
client.on("chat", function (channel, userstate, message, self) {
if(!say.isSpeaking()){
say.speak(userstate.username + " says " + message, TextToSpeech.QUEUE_FLUSH,null);
}
});
或在 QUE 中添加 TXT
client.on("chat", function (channel, userstate, message, self) {
say.speak(userstate.username + " says " + message, TextToSpeech.QUEUE_ADD,null);
});