ionic 5 cordova语音识别器如何语音发短信?

时间:2019-11-11 15:48:21

标签: angular cordova ionic-framework speech-recognition

我正在尝试在开始收听语音时捕获文本,但是我不知道如何实现。

这是我当前拥有的代码:

// Start the recognition process
this.speechRecognition.startListening(options)
  .subscribe(
    (matches: string[]) => {
      console.log(matches);
      this.cd.detectChanges();
      for (let index = 0; index < matches.length; index++) {
        this.texto.push( matches[index] );
      }
      alert('Empezar a escuchar');
      this.cd.detectChanges();
    },
    (onerror) => {
      console.log('error:', onerror);
      alert('error' + JSON.stringify(onerror));
    }
)  

0 个答案:

没有答案