我正在使用以下语音识别库-
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
我认为,我在那里缺少一些东西。预先感谢!