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.


Comments

Popular posts from this blog

Are Regular VACUUM ANALYZE Still Recommended Under 9.1?

Can Feynman Diagrams Be Used To Represent Any Perturbation Theory?