You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
const userInput = "your user input here"; // Get the user's input
const commandKeywords = ["keyword1", "keyword2", "keyword3"];
// Check if any of the keywords are present in the user's input
for (const keyword of commandKeywords) {
if (userInput.includes(keyword)) {
// Perform the action associated with the matched keyword
// This can be a function call or any other action
console.log(Matched keyword: ${keyword});
break; // Stop checking once a match is found
}
}
How to force annyang.trigger('command') to work, even if NOT in listening mode or Speech API is not available on browser.
Thanks
The text was updated successfully, but these errors were encountered: