ReferenceError: SpeechRecognition is not defined

Viewed 950

I am using following speech recognition library -

https://github.com/kamiazya/ngx-speech-recognition

Component providers

providers: [
{
      provide: SpeechRecognitionLang,
      useValue: 'en-US',
},
{
      provide: SpeechRecognitionMaxAlternatives,
      useValue: 1,
 },
 SpeechRecognitionService,
 RxSpeechRecognitionService ],

Here is the service call for recognition

openVoiceRecognition(){
        this.service
      .listen()
      .pipe(resultList)
      .subscribe((list: SpeechRecognitionResultList) => {
        let message = list.item(0).item(0).transcript;
                this.searchProductFromAPI(message);
      });
    }

Everything works fine except in terminal I get following error -

ReferenceError: SpeechRecognition is not defined at RxSpeechRecognitionService.SpeechRecognitionCommon

I think, I am missing something there. Thanks in advance!

0 Answers
Related