Class SpeechSynthesizerV2

java.lang.Object
com.alibaba.dashscope.legacy_2x.audio.ttsv2.SpeechSynthesizerV2
All Implemented Interfaces:
AudioWebsocketCallback

@Deprecated public final class SpeechSynthesizerV2 extends Object implements AudioWebsocketCallback
Deprecated.
Author:
songsong.sss
  • Constructor Details

    • SpeechSynthesizerV2

      public SpeechSynthesizerV2(SpeechSynthesisParam param, ResultCallback<SpeechSynthesisResult> callback, String baseUrl, ConnectionOptions connectionOptions)
      Deprecated.
      CosyVoice Speech Synthesis SDK
      Parameters:
      param - Configuration for speech synthesis, including voice type, volume, etc.
      callback - In non-streaming output scenarios, this can be set to null
      baseUrl - Base URL
      connectionOptions - Connection options
    • SpeechSynthesizerV2

      public SpeechSynthesizerV2(String baseUrl, ConnectionOptions connectionOptions)
      Deprecated.
      CosyVoice Speech Synthesis SDK
      Parameters:
      baseUrl - Base URL
      connectionOptions - Connection options
    • SpeechSynthesizerV2

      public SpeechSynthesizerV2()
      Deprecated.
      CosyVoice Speech Synthesis SDK
    • SpeechSynthesizerV2

      public SpeechSynthesizerV2(SpeechSynthesisParam param, ResultCallback<SpeechSynthesisResult> callback, String baseUrl)
      Deprecated.
      CosyVoice Speech Synthesis SDK
      Parameters:
      param - Configuration for speech synthesis, including voice type, volume, etc.
      callback - In non-streaming output scenarios, this can be set to null
      baseUrl - Base URL
    • SpeechSynthesizerV2

      public SpeechSynthesizerV2(SpeechSynthesisParam param, ResultCallback<SpeechSynthesisResult> callback)
      Deprecated.
      CosyVoice Speech Synthesis SDK
      Parameters:
      param - Configuration for speech synthesis, including voice type, volume, etc.
      callback - In non-streaming output scenarios, this can be set to null
  • Method Details

    • updateParamAndCallback

      public void updateParamAndCallback(SpeechSynthesisParam param, ResultCallback<SpeechSynthesisResult> callback)
      Deprecated.
    • getLastRequestId

      public String getLastRequestId()
      Deprecated.
    • connect

      public void connect() throws NoApiKeyException, InterruptedException
      Deprecated.
      Throws:
      NoApiKeyException
      InterruptedException
    • close

      public void close()
      Deprecated.
    • startSynthesizer

      public void startSynthesizer(boolean enableSsml) throws InterruptedException
      Deprecated.
      Throws:
      InterruptedException
    • sendText

      public void sendText(String text)
      Deprecated.
    • sendFlush

      public void sendFlush(com.google.gson.JsonObject params)
      Deprecated.
      Sends a flush directive, asking the server to synthesize the text buffered so far without ending the session.
      Parameters:
      params - Optional fields carried next to the flush flag, may be null. Keys already present are kept, so the flush flag itself cannot be overridden.
    • stopSynthesizer

      public void stopSynthesizer()
      Deprecated.
    • onOpen

      public void onOpen()
      Deprecated.
      Specified by:
      onOpen in interface AudioWebsocketCallback
    • onMessage

      public void onMessage(okhttp3.WebSocket webSocket, String text)
      Deprecated.
      Specified by:
      onMessage in interface AudioWebsocketCallback
    • onMessage

      public void onMessage(okhttp3.WebSocket webSocket, ByteBuffer bytes)
      Deprecated.
      Specified by:
      onMessage in interface AudioWebsocketCallback
    • onError

      public void onError(okhttp3.WebSocket webSocket, Throwable t)
      Deprecated.
      Specified by:
      onError in interface AudioWebsocketCallback
    • onClose

      public void onClose(int code, String reason)
      Deprecated.
      Specified by:
      onClose in interface AudioWebsocketCallback
    • getFirstPackageDelay

      public long getFirstPackageDelay()
      Deprecated.
      First Package Delay is the time between start sending text and receive first audio package
    • streamingComplete

      public void streamingComplete(long completeTimeoutMillis)
      Deprecated.
    • streamingComplete

      public void streamingComplete()
      Deprecated.
    • asyncStreamingComplete

      public void asyncStreamingComplete()
      Deprecated.
    • streamingCancel

      public void streamingCancel()
      Deprecated.
    • streamingCall

      public void streamingCall(String text)
      Deprecated.
    • streamingFlush

      public void streamingFlush()
      Deprecated.
      Forces the server to synthesize the text submitted so far. The session stays open, so streamingCall() can keep sending text afterwards.
    • streamingFlush

      public void streamingFlush(com.google.gson.JsonObject params)
      Deprecated.
      Forces the server to synthesize the text submitted so far. The session stays open, so streamingCall() can keep sending text afterwards.
      Parameters:
      params - Optional fields carried next to the flush flag, may be null.
    • call

      public ByteBuffer call(String text, long timeoutMillis) throws RuntimeException
      Deprecated.
      Throws:
      RuntimeException
    • call

      public ByteBuffer call(String text)
      Deprecated.
    • getStartedTimeout

      public long getStartedTimeout()
      Deprecated.
    • setStartedTimeout

      public void setStartedTimeout(long startedTimeout)
      Deprecated.
    • getFirstAudioTimeout

      public long getFirstAudioTimeout()
      Deprecated.
    • setFirstAudioTimeout

      public void setFirstAudioTimeout(long firstAudioTimeout)
      Deprecated.