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
1 Answer
Reset to default 10The 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>