Guest User

Untitled

a guest
Sep 14th, 2018
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. private init(): void {
  2. this._supportRecognition = true;
  3. console.log(window['SpeechRecognition']);
  4. if (window['SpeechRecognition']) {
  5. this._speech = new SpeechRecognition();
  6. } else if (window['webkitSpeechRecognition']) {
  7. this._speech = new webkitSpeechRecognition();
  8. } else if(window['msSpeechRecognition']){
  9. this._speech = new msSpeechRecognition();
  10. } else {
  11. this._supportRecognition = false;
  12. }
  13. console.log(`Speech supported: ${this._supportRecognition}`);
  14. }
Add Comment
Please, Sign In to add comment