annyang
annyang copied to clipboard
Annyang keeps starting and stopping
Annyang does not seem to work on in my browser (see details below). The Annyang main page (demo app) does not work and I think it's the same reason as the reason why my own project does not work. The problem is made visible through SpeechKITT because I see the recording starting and stopping.
What I'm trying in my own application:
I am trying to get annyang (with SpeechKITT) added to my app. I use the following code:
if (annyang) {
console.log("starting annayang");
var commands = {
"add something *name": function (name) {
alert(name);
},
};
annyang.addCommands(commands);
SpeechKITT.annyang();
SpeechKITT.setStylesheet(
"//cdnjs.cloudflare.com/ajax/libs/SpeechKITT/1.0.0/themes/flat.css"
);
SpeechKITT.vroom();
} else {
console.log("annayang is missing");
}
}
Expected Behavior
I expect, when I press the "mic icon" and start voice that I can talk and the voice commands get recorded and handled.
Current Behavior
What happens is that I click start and it immediately stops. If I add a onStop
handler it immediately get's fired after the onStart
handler.
Annyang get's configured only once, I can read out the console.log("starting annayang");
.
Possible Solution
I've tried: #257, but to no avail. I am working in a svelte app. At first I thought it was because the app rerenders, but this wasn't it. I've tried the main index page and also a separate page without anything on it, the behavior is the same.
Context
I'm working on an app where voice commands would help people who have trouble typing, this component is an important part of the app.
Your Environment
- Version used:
- annyang 2.6.0 (loaded through cloudflare
- SpeechKITT 1.0.0 (loaded through cloudflare)
- Browser name and version: Brave Version 1.26.67 Chromium: 91.0.4472.114 (Official Build) (64-bit)
- Operating system and version (desktop or mobile): Windows 10
- Link to your project: can't link it, if needed I can try and replicate in another project.