Interface SpeechClientInterface

All Superinterfaces:
AutoCloseable
All Known Implementing Classes:
VertexSpeechClient

public interface SpeechClientInterface extends AutoCloseable
用于语音转文本(speech-to-text)功能的客户端接口。该接口支持多种实现方式(例如:基于云服务的实现方式、模拟测试环境等)。
  • 方法概述

    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)
    执行同步语音识别功能。
  • 方法详细信息(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

      void close() throws Exception
      关闭客户端并释放所有资源。
      Specified by:
      close in interface AutoCloseable
      Throws:
      Exception - if an error occurs during closing.