Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

Google Speech to Text API from Web page for streaming audio from microphone

Is there a concise example where a user from a web page is initiate speech thru their local microphone, which is streamed to Google Speech to Text API and then respond with realtime text transcipt for the user. I saw this site https://www.google.com/intl/en/chrome/demos/speech.html but dont seem to find the source or example code posted any where.

Thanks in advance.

1 1 179
1 REPLY 1

Hi @mobileraj ,

Google doesn’t provide an official browser-to-Speech-to-Text API streaming example out of the box, but you can build it using:

  • Web browser side: use WebRTC / Web Audio API to capture the mic stream.

  • Backend server: stream audio to Google Speech-to-Text API using a WebSocket or gRPC.

A good starting point:
https://cloud.google.com/speech-to-text/docs/streaming-recognize

Top Labels in this Space