This page contains code samples for Speech-to-Text. To search and filter code samples for other Google Cloud products, see the Google Cloud sample browser.
Make an audio transcription request
Transcribe a local audio file synchronously.
View in documentation
Migrating to the Python client library v0.27: Migration client
Part of the guide for migrating to the Python client library v0.27.
Streaming speech recognition with punctuation
Performs streaming speech recognition on raw PCM audio data.
Synchronously recognizes punctuation
Performs transcription with automatic punctuation on raw PCM audio data.
Synchronously transcribe a local file
Perform synchronous transcription on a local audio file.
View in documentation
Transcribe a file in Cloud Storage using a transcription model
Transcribe an audio file in Cloud Storage using a trained transcription model.
View in documentation
Transcribe a file in Cloud Storage with word-level confidence (beta)
Transcribe an audio file stored in Cloud Storage, returning the confidence level for each word.
View in documentation
Transcribe a file with word-level confidence (beta)
Transcribe an audio file, returning the confidence level for each word.
View in documentation
View in documentation
Transcribe a local file using a transcription model
Transcribe a local audio file using a trained transcription model.
View in documentation
Transcribe a local file using an enhanced speech recognition (beta)
Transcribe a local audio file, where you specify an enhanced model.
Transcribe a local file using an enhanced speech recognition model
Transcribe a local audio file, where you specify an enhanced model.
View in documentation
Transcribe a local file with auto punctuation
Transcribe a local audio file, including auto punctuation.
View in documentation
Transcribe a local file with auto punctuation (beta)
Transcribe a local audio file, including auto punctuation.
Transcribe a local multi-channel file
Transcribe a local audio file that includes more than one channel.
View in documentation
Transcribe a local multi-channel file (beta)
Transcribe a local audio file that includes more than one channel.
View in documentation
Transcribe a local multi-lingual file (beta)
Transcribe a local audio file that includes more than one language.
View in documentation
Transcribe a multi-channel file in Cloud Storage
Transcribe an audio file stored in Cloud Storage that includes more than one channel.
View in documentation
Transcribe a multi-lingual file in Cloud Storage (beta)
Transcribe an audio file stored in Cloud Storage that includes more than one language.
View in documentation
Transcribe streaming audio from a microphone
Transcribe streaming audio from a microphone.
View in documentation
Transcription of a file in Cloud Storage with diarization
Recognize multiple speakers in an audio file stored in Cloud Storage.
Transcription of a file in Cloud Storage with diarization (beta)
Recognize multiple speakers in an audio file stored in Cloud Storage.
View in documentation
Transcription of a local file with diarization
Recognize multiple speakers in a local audio file.
Try it for yourself
If you're new to Google Cloud, create an account to evaluate how Speech-to-Text performs in real-world scenarios. New customers also get $300 in free credits to run, test, and deploy workloads.
Try Speech-to-Text free