使用 node.js 在浏览器中启用麦克风并捕获所说的信息

Enabling the microphone in a browser using node.js and capturing the information spoken

我已经苦苦挣扎了一段时间,并且一直在查看许多关于如何使用 Node.js 在浏览器中启用麦克风的示例。我看过几个 Javascript 示例,但是,我无法从中获取口语内容并将其存储在变量中。如何使用 Node.js 启用麦克风?我需要一个特定的 npm 包吗?我目前正在使用 IBM Watson Speech to Text api。任何帮助表示赞赏!提前致谢!

您需要使用客户端库在浏览器中启用麦克风。

在此处使用 Speech-to-Text SDK:

https://github.com/watson-developer-cloud/speech-javascript-sdk

这里有一个工作示例:

https://watson-speech.mybluemix.net/microphone-streaming.html

请注意,流媒体麦克风不适用于任何版本的 Safari。您将需要使用 FireFox、Chrome 或 IE 将流式麦克风用于 Watson Speech to Text。这里有一个关于使用 Speech to Text 构建简单的 Bluemix 应用程序的 YouTube 教程:(请参阅第 3 章)Youtube TutorialThe supporting code is in a public git repo here: Zero To Cognitive Repo