问题标签 [webkitspeechrecognition]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
0 回答
44 浏览

javascript - mac Safari 上的 SpeechRecognition 事件监听器

我正在使用 Web API SpeechRecognition 构建应用程序,但 onspeechstart 和 onspeechend 侦听器不起作用。 https://developer.mozilla.org/ja/docs/Web/API/SpeechRecognition

Safari 的版本是 15.0。

相关代码如下。语言是打字稿(javascript)。

在 Safari 中使用这些事件侦听器是否需要任何设置?如果您对此有所了解,如果您能告诉我,我将不胜感激。

0 投票
0 回答
20 浏览

javascript - 我总是在 Javascript 语音识别中的 recongition.onerror() 侦听器中遇到网络错误

我正在创建一个应用程序,我想在 JavaScript 中使用语音识别向用户询问多个问题作为语音输入,但是当用户给出第一个答案时,即使在用户停止说话并在识别.onerror() 事件监听器中之后,迈克也会听很长时间打印的网络错误消息即使我的互联网工作正常,任何人都可以帮助解决这个问题。

0 投票
0 回答
12 浏览

javascript - WebkitSpeechSynthesis Voices won't change consistently

I have this code for WebkitSpeechRecognition. I have a feature, where when the user selects the dropdown menu, they can choose what voice they want. However, when you select a voice and press "Speak," the voice stays the same. When you press play again, the voice finally changes, and when you press play for the third time, the voice reverts back to default. How can avoid this error, so that whenever I call the function speak(), the voice that the user selected will speak with that same voice?

Here is my code:

Thanks.

0 投票
1 回答
41 浏览

javascript - Web 语音 api 返回旧的成绩单

我有这个角度服务,通过网络语音将语音翻译成文本

我从文件中调用此服务函数,.ts就像我在启动时调用 this.service.init() 一样,然后this.service.start()在此之后我调用this.service.stop()this.service.reinit()但我仍然使用result event listenerintemp_trans变量中的新值获取旧值我不想使用我想要的旧值如果我阻止它,新的价值观this.service.stop()

任何解决方案都受到高度赞赏。谢谢

0 投票
0 回答
14 浏览

javascript - javascript语音到文本和文本到语音一起

我有一个使用 webkitSpeechRecognition 和 window.speechSynthesis 的 webapp。如果单独使用,它们可以正常工作:

  • 当我说话时,webkitSpeechRecognition 会转录部分和结尾。
  • 当我键入一个单词时,从扬声器中听到 window.speechSynthesis

我如何一起使用它们?显然 window.speechSynthesis 和 webkitSpeechRecognition 似乎不能一起工作。该设备要么拦截麦克风并对其进行转录,要么使用扬声器说话,但它似乎无法同时做这两件事