This section demonstrates how to transcribe streaming audio, like the input from a microphone, to text.
Streaming speech recognition lets you stream audio to Cloud Speech-to-Text and receive a stream speech recognition results in real time as the audio is processed. See also the audio limits for streaming speech recognition requests. Streaming speech recognition is available via gRPC only.
Perform streaming speech recognition on a local file
The following is an example of performing streaming speech recognition on a local audio
file. There is a 10 MB limit on all streaming requests sent to the API. This
limit applies to to both the initial StreamingRecognize request
and the size of each individual message in the stream. Exceeding this limit will
throw an error.
Go
To learn how to install and use the client library for Cloud STT, see Cloud STT client libraries. For more information, see the Cloud STT Go API reference documentation.
To authenticate to Cloud STT, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.