Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private init(): void {
- this._supportRecognition = true;
- console.log(window['SpeechRecognition']);
- if (window['SpeechRecognition']) {
- this._speech = new SpeechRecognition();
- } else if (window['webkitSpeechRecognition']) {
- this._speech = new webkitSpeechRecognition();
- } else if(window['msSpeechRecognition']){
- this._speech = new msSpeechRecognition();
- } else {
- this._supportRecognition = false;
- }
- console.log(`Speech supported: ${this._supportRecognition}`);
- }
Add Comment
Please, Sign In to add comment