类:VertexSpeechClient

java.lang.Object
com.google.adk.flows.llmflows.audio.VertexSpeechClient
All Implemented Interfaces:
SpeechClientInterface, AutoCloseable

public class VertexSpeechClient extends Object implements SpeechClientInterface
使用 Vertex AI SpeechClient 实现 SpeechClientInterface。
  • 构造函数概述

    Constructors
    Constructor
    Description
    用于创建一个 `VertexSpeechClient` 对象,并初始化其底层的 Google Cloud SpeechClient。
  • 方法概述

    Modifier and Type
    Method
    Description
    void
    关闭客户端并释放所有资源。
    com.google.cloud.speech.v1.RecognizeResponse
    recognize(com.google.cloud.speech.v1.RecognitionConfig config, com.google.cloud.speech.v1.RecognitionAudio audio)
    对给定的音频输入执行同步语音识别。

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 构造函数详细信息

    • VertexSpeechClient

      public VertexSpeechClient() throws IOException
      用于创建一个 `VertexSpeechClient` 对象,并初始化其底层的 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)
      对给定的音频输入执行同步语音识别。
      Specified by:
      recognize in interface SpeechClientInterface
      Parameters:
      config - Recognition configuration (e.g., language, encoding).
      audio - Audio data to recognize.
      Returns:
      The recognition result.
    • close

      public void close() throws Exception
      描述内容复制自接口文档: SpeechClientInterface
      关闭客户端并释放所有资源。
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface SpeechClientInterface
      Throws:
      Exception - if an error occurs during closing.