Rajesh
Rajesh

Reputation: 21

Annyang causes chrome ask to allow microphone before it starts

I've added [Annyang]: https://github.com/TalAter/annyang to my AngularJS app, just as shown in the demo. Problem is, that Chrome fires the pop up to allow using the microphone when the application is up, and not only when start using Annyang. Why is does it happen?

index.html:

script src="//cdnjs.cloudflare.com/ajax/libs/annyang/2.6.1/annyang.min.js">

Angular code:

    private onVoiceSearchStart() {
        if (annyang) {
              // Let's define a command.

              var commands = {
                'search for *searchString': function(searchString) { 
                    // run search
                }
              };

              // Add our commands to annyang
              annyang.addCommands(commands);

              // Start listening.
              annyang.start();
            }
    }

Upvotes: 1

Views: 481

Answers (1)

Tal Ater
Tal Ater

Reputation: 1189

The permission request dialog will pop up as soon as the browser's speech recognition engine is triggered to start listening. This happens when you call annyang.start().

Upvotes: 1

Related Questions