Class | Description |
---|---|
SpeechClient |
Service Description: Service that implements Google Cloud Speech API.
|
SpeechSettings |
Settings class to configure an instance of
SpeechClient . |
SpeechSettings.Builder |
Builder for SpeechSettings.
|
The interfaces provided are listed below, along with usage samples.
============ SpeechClient ============
Service Description: Service that implements Google Cloud Speech API.
Sample for SpeechClient:
try (SpeechClient speechClient = SpeechClient.create()) {
RecognitionConfig.AudioEncoding encoding = RecognitionConfig.AudioEncoding.FLAC;
int sampleRateHertz = 44100;
String languageCode = "en-US";
RecognitionConfig config = RecognitionConfig.newBuilder()
.setEncoding(encoding)
.setSampleRateHertz(sampleRateHertz)
.setLanguageCode(languageCode)
.build();
String uri = "gs://bucket_name/file_name.flac";
RecognitionAudio audio = RecognitionAudio.newBuilder()
.setUri(uri)
.build();
RecognizeResponse response = speechClient.recognize(config, audio);
}
Copyright © 2019 Google LLC. All rights reserved.