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

Chemistry - Bond Angles In NH3 And NCl3

Are Regular VACUUM ANALYZE Still Recommended Under 9.1?

Change The Font Size Of Visual Studio Solution Explorer