How to know if webkitSpeechRecognition is started?

Viewed 5141

I'm making a bot to listen to my voice.
So i did :

this.recognition = new webkitSpeechRecognition();

I can do this to start listen :

this.recognition.start();

And this to stop listen :

this.recognition.stop();

But do you know a function that will return me true if this.recognition is started and false if it's stopped ? Like "isStarted()" ?

Thanks.

2 Answers

You can simple check this

if(this.recognition){
    //do something if true
}else{
    // do something else if false
}
Related