Registry / cloud / go-speech

go-speech

JSON →
library1.25.2gogounverified

Package speech provides a client for the Google Cloud Speech-to-Text API for audio transcription.

go get cloud.google.com/go/speech
INSTALL
IMPORT
SIG · GO-SPEECH
G
go-speech
cloudgov1.25.2
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

speech
cloud.google.com/go/speech/apiv1

Transcribe audio using Google Cloud Speech-to-Text

package main import ( "context" "fmt" speech "cloud.google.com/go/speech/apiv1" "cloud.google.com/go/speech/apiv1/speechpb" ) func main() { ctx := context.Background() client, _ := speech.NewClient(ctx) resp, _ := client.Recognize(ctx, &speechpb.RecognizeRequest{ Config: &speechpb.RecognitionConfig{ Encoding: speechpb.RecognitionConfig_LINEAR16, SampleRateHertz: 16000, LanguageCode: "en-US", }, Audio: &speechpb.RecognitionAudio{ AudioSource: &speechpb.RecognitionAudio_Uri{Uri: "gs://bucket/audio.raw"}, }, }) for _, result := range resp.Results { fmt.Println(result.Alternatives[0].Transcript) } }
Debug
Known issues

No known issues recorded.

Upgrade
Version history
1.25.2latest on pkg.go.dev
Audit
Dependencies

No dependency data recorded yet.

Agent activity
10 hits · last 30 days
node
10
Resources
go-speech — go get go-speech · libregistry