Search code examples
google-speech-apigoogle-cloud-platform

Google Speech API from the browser


In the documentation page https://cloud.google.com/speech/ there is a demo example that listens to speech via the browser and uses the API in the background. Is the source for this demo available?

If not, the speech API uses flac files. Is there any open source project that can record flacfiles from the browser (that is compatible with this API - there are many github projects out there but wondering if there is an official one)?


Solution

  • In case it helps someone, this approach is a good start to start recording audio from the browser:

    https://github.com/GoogleCloudPlatform/nodejs-docs-samples/blob/master/speech/recognize.js

    https://developers.google.com/web/fundamentals/native-hardware/recording-audio/#acquire_access_to_the_microphone

    and https://github.com/mattdiamond/Recorderjs

    Edit: The solution was open-sourced as its own project: https://github.com/gridcellcoder/cloud-speech-and-vision-demos