ReferenceError: SpeechRecognition не определено - PullRequest
3 голосов
/ 09 октября 2019

Я использую следующую библиотеку распознавания речи -

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

Компонент providers

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

Вот вызов service для распознавания

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

Все работает нормально, за исключением терминала, я получаю следующую ошибку -

ReferenceError: SpeechRecognition не определен в RxSpeechRecognitionService.SpeechRecognitionCommon

Я думаю, яя что-то там упускаю. Заранее спасибо!

...