I've tested Annyang in a blank file first. This worked fine, but when I connected the same code to a function in another file it didn't seem te be working. It seemed that the annyang was not connected anymore. The browser didn't ask for permission to use the microphone neither was the red circle visible. However, I've connected it the same way I did while testing.
function: playerRotate(1); I want to start when the user says: turn.
Below you can find my code:
The javascript `
$( document ).ready( doStuff );
function doStuff()
{
if (annyang) {
var commands = {
'turn': function() {
playerRotate(1);
console.log("You said turn");
}
};
annyang.addCommands(commands);
annyang.debug(true);
annyang.start({ continuous: false });
}
annyang.setLanguage('en-GB');
This is the scripttag that I've put in the head of the hmtl: <script src="https://cdnjs.cloudflare.com/ajax/libs/annyang/1.1.0/annyang.min.js"></script>
And I've put the script tag for the main javascript file at the bottom of the body of the html.
Can anyone help to find what I'm doing wrong?
Thanks so much in advance!