Search code examples
google-speech-api

Google Speech API streaming audio


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?


Solution

  • The demo on the Google Cloud speech page doesn't exactly use the API directly from the browser. They open a websocket to a backend server that actually talks to Speech api from the server. It is possible to do the STT on the client browser directly using REST api but if you want real-time transcription, you have to have your own intermediary server with websocket mediation to the gRPC based Speech api.

    You can find the code/demo of the websocket based architecture here: https://github.com/googlecodelabs/speaking-with-a-webpage