Class VertexSpeechClient
java.lang.Object
com.google.adk.flows.llmflows.audio.VertexSpeechClient
- All Implemented Interfaces:
SpeechClientInterface,AutoCloseable
Implementation of SpeechClientInterface using Vertex AI SpeechClient.
-
Constructor Summary
ConstructorsConstructorDescriptionConstructs a VertexSpeechClient, initializing the underlying Google Cloud SpeechClient. -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Closes the client and releases any resources.com.google.cloud.speech.v1.RecognizeResponserecognize(com.google.cloud.speech.v1.RecognitionConfig config, com.google.cloud.speech.v1.RecognitionAudio audio) Performs synchronous speech recognition on the given audio input.
-
Constructor Details
-
VertexSpeechClient
Constructs a VertexSpeechClient, initializing the underlying Google Cloud SpeechClient.- Throws:
IOException- if SpeechClient creation fails.
-
-
Method Details
-
recognize
public com.google.cloud.speech.v1.RecognizeResponse recognize(com.google.cloud.speech.v1.RecognitionConfig config, com.google.cloud.speech.v1.RecognitionAudio audio) Performs synchronous speech recognition on the given audio input.- Specified by:
recognizein interfaceSpeechClientInterface- Parameters:
config- Recognition configuration (e.g., language, encoding).audio- Audio data to recognize.- Returns:
- The recognition result.
-
close
Description copied from interface:SpeechClientInterfaceCloses the client and releases any resources.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceSpeechClientInterface- Throws:
Exception- if an error occurs during closing.
-