Hi, I am currently having an issue with a piece of html that uses the annyang
framework for html speech recognition. With my current code, if you allow your microphone and say "Hello world" a new google tab will open. My issue is when you try saying "Hello world" and you aren't on the tab with my fiddle running, nothing will happen. Only when your on the actual tab with the code and you say "hello world" will something happen. Im wondering if theres a way my code could run in the background so no matter what tab you're currently on, if you say "hello world" my code will be triggered and open a new tab.
##Links ##
Link to a fiddle with my code: https://jsfiddle.net/04nc1mjd/
Link to the annyang framework used for speech recognition: https://github.com/TalAter/annyang
My code:
<!DOCTYPE html>
<html lang="es">
<head>
<script src="https://cdnjs.cloudflare.com/ajax/libs/annyang/2.6.0/annyang.min.js"></script>
</head>
<body>
<script>
if (annyang) {
var openNew = {
'Hello world': function() {
window.open("https://google.ca");
}
};
annyang.addCommands(openNew);
annyang.start();
}
</script>
</body>
</html>