Interface SpeechClientInterface
- All Superinterfaces:
AutoCloseable
- All Known Implementing Classes:
VertexSpeechClient
用于语音转文本(speech-to-text)功能的客户端接口。该接口支持多种实现方式(例如:基于云服务的实现方式、模拟测试环境等)。
-
方法概述
-
方法详细信息(Method Details)
-
recognize
com.google.cloud.speech.v1.RecognizeResponse recognize(com.google.cloud.speech.v1.RecognitionConfig config, com.google.cloud.speech.v1.RecognitionAudio audio) throws Exception 执行同步语音识别功能。- Parameters:
config- The recognition configuration.audio- The audio data to transcribe.- Returns:
- The recognition response.
- Throws:
Exception- if an error occurs during recognition.
-
close
关闭客户端并释放所有资源。- Specified by:
closein interfaceAutoCloseable- Throws:
Exception- if an error occurs during closing.
-