Closed Zoom-Developer closed 2 years ago
I added option where you can customise who should be ignored from speech recognition in #41 You could do something like this to ignore all bots except yours:
addSpeechEvent(client, {
shouldProcessSpeech: (user) => {
if (user.bot && user.username !== "Your bot name") {
return false;
}
return true;
}
}
Is this what you want?
Thanks, yes! I'm not sure if it's worth posting here, but I thought I'd say it straight in this question, I found a bug where sometimes the speech is called multiple times, with slightly changed content, which is not the best result. How can I fix this?
Can you give a way of reproduction?
I don't know English very well, what do you mean by reproduction?
When does this problem occur? Is it random or maybe after multiple people/bots joins the voice channel?
No, 1 person says and about once every 10-15 calls the call is repeated several times, I assume that this is somehow connected with Google's speech recognition
Okay, I think I found the reason for this problem
const opusStream = receiver.subscribe(userId, {
end: {
behavior: EndBehaviorType.AfterSilence,
duration: 1000,
},
});
Bot is waiting 1 second after someone has stopped speaking and when someone stops talking for specific time (more than 300ms, less than 1 second) the speaking event is fired again, but recent one is still listening for audio, so there are 2 speech events for one speaking session. Don't worry if you don't understand it (it's really hard for me to explain it well), I will fix it as soon as possible.
Look forward to)
Update discord-speech-recognition package, this issue should be fixed now and you can use this new option shouldProcess
to listen only to your bot
Thanks
I need my bot to ignore all bots except for one of mine. I could not find this functionality not in discord.js, not in this library