For this example, we'll use the streaming SpeechToText
grpc service to transcribe an audio file with VNG Cloud Speech Text AI
.
- Golang 1.22 or above
- A VNG Cloud Account
- Pakage
pkg-config
andportaudio
- Enable the Speech-to-Text API
- Create a service account with action
ai-stt-tts:StreamingSpeechToText
permission and download the service account key
git clone https://github.com/vngcloud/stt-streaming-example.git
The proto file is located at proto/stt.proto
. You can generate the gRPC client by running the following command:
cd proto
./generate.sh
cd ../
For build and run the example
#file streaming example
go build -o file ./examples/file/main.go
#mic streaming example
go build -o mic ./examples/mic/main.go
./file -h
Usage of ./file:
-client_id string
Client ID
-client_secret string
Client Secret
-file string
File path
Example:
./file -client_id <client_id> -client_secret <client_secret> -file <file_path>
./mic -h
Usage of ./mic:
-client_id string
Client ID
-client_secret string
Client Secret
Example:
./mic -client_id <client_id> -client_secret <client_secret>