最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

Google Cloud Speech with Javascript - Stack Overflow

programmeradmin4浏览0评论

In documentation and tutorial for REST API (Google Sppech API for Node: ), so my question is how to use the Cloud Speech API in JavaScript. Someone used on any page with javascript?


2020-04-24 EDIT: The accepted answer is using webkitSpeechRecognition which is not available on mobile:

Google documentation and examples:

Node.js code: .js

REQUIREMENT: it has to run in Safari on iOS.

In documentation and tutorial for REST API (Google Sppech API for Node: https://cloud.google./nodejs/apis), so my question is how to use the Cloud Speech API in JavaScript. Someone used on any page with javascript?


2020-04-24 EDIT: The accepted answer is using webkitSpeechRecognition which is not available on mobile: https://stackoverflow./a/61039699/775359

Google documentation and examples: https://cloud.google./speech-to-text/docs/samples

Node.js code: https://github./googleapis/nodejs-speech/blob/master/samples/MicrophoneStream.js

REQUIREMENT: it has to run in Safari on iOS.

Share Improve this question edited Apr 26, 2020 at 14:38 Mars Robertson 13.2k13 gold badges72 silver badges93 bronze badges asked Aug 5, 2016 at 11:22 Thiago F. ToledoThiago F. Toledo 3131 gold badge2 silver badges10 bronze badges 2
  • I think you have the wrong idea about what the google cloud API's are all about - perhaps this is closer to what you need – Jaromanda X Commented Aug 5, 2016 at 12:00
  • Did you aplish this, with just javaScript? – Ivalberto Commented Aug 25, 2021 at 11:50
Add a ment  | 

1 Answer 1

Reset to default 10

The Google Cloud API is more specifically used for server-side speech processing. If you're looking to use voice recognition through a browser, you should use your browser's built in Web Speech API. Here's a simple example:

var recognition = new webkitSpeechRecognition();
recognition.continuous = true;

var output = document.getElementById('output');
recognition.onresult = function(event) {
  output.textContent = event.results[0][0].transcript;
};
<div id="output"></div>
<button onclick="recognition.start()">Start</button>
<button onclick="recognition.stop()">Stop</button>

发布评论

评论列表(0)

  1. 暂无评论