Skip to content Skip to sidebar Skip to footer

Angular2: Web Speech API - Voice Recognition


Answer :

Finally I solved creating an interface!!

export interface IWindow extends Window {   webkitSpeechRecognition: any; } 

And:

const {webkitSpeechRecognition} : IWindow = <IWindow>window; const recognition = new webkitSpeechRecognition(); 

In Angular 9, it worked me but using const speechRecognition = window['webkitSpeechRecognition']; note that the window 'w' is lowercase.


Post a Comment for "Angular2: Web Speech API - Voice Recognition"