Class HttpSpeechSynthesisResult

java.lang.Object
com.alibaba.dashscope.legacy_2x.audio.http_tts.HttpSpeechSynthesisResult

@Deprecated public class HttpSpeechSynthesisResult extends Object
Deprecated.
Result class for HTTP TTS synthesis. Contains the synthesized audio data and related metadata.

For SSE streaming calls, the result contains binary audio data in audioData. For non-SSE synchronous calls, the result contains an audio URL in audioInfo.

Author:
DashScope SDK Team
  • Constructor Details

    • HttpSpeechSynthesisResult

      public HttpSpeechSynthesisResult()
      Deprecated.
  • Method Details

    • hasAudioData

      public boolean hasAudioData()
      Deprecated.
      Checks if audio data is present in this result (SSE mode).
      Returns:
      true if audio data is available, false otherwise
    • getAudioDataSize

      public int getAudioDataSize()
      Deprecated.
      Gets the size of the audio data in bytes.
      Returns:
      the size in bytes, or 0 if no audio data is present
    • hasAudioUrl

      public boolean hasAudioUrl()
      Deprecated.
      Checks if audio URL is present in this result (non-SSE mode).
      Returns:
      true if audio URL is available, false otherwise
    • getAudioUrl

      public String getAudioUrl()
      Deprecated.
      Gets the audio URL.
      Returns:
      the audio URL, or null if not available
    • getRequestId

      public String getRequestId()
      Deprecated.
      The request ID for tracking.
    • getAudioData

      public byte[] getAudioData()
      Deprecated.
      The audio data in binary format (for SSE streaming calls).
    • getAudioInfo

      public AudioInfo getAudioInfo()
      Deprecated.
      The audio URL and metadata (for non-SSE synchronous calls).
    • getUsage

      public SpeechSynthesisUsage getUsage()
      Deprecated.
      The usage statistics (if available).
    • getOutput

      public com.google.gson.JsonObject getOutput()
      Deprecated.
      The raw output from the API (may contain additional metadata).
    • getFinishReason

      public String getFinishReason()
      Deprecated.
      The finish reason (e.g., "stop").
    • setRequestId

      public void setRequestId(String requestId)
      Deprecated.
      The request ID for tracking.
    • setAudioData

      public void setAudioData(byte[] audioData)
      Deprecated.
      The audio data in binary format (for SSE streaming calls).
    • setAudioInfo

      public void setAudioInfo(AudioInfo audioInfo)
      Deprecated.
      The audio URL and metadata (for non-SSE synchronous calls).
    • setUsage

      public void setUsage(SpeechSynthesisUsage usage)
      Deprecated.
      The usage statistics (if available).
    • setOutput

      public void setOutput(com.google.gson.JsonObject output)
      Deprecated.
      The raw output from the API (may contain additional metadata).
    • setFinishReason

      public void setFinishReason(String finishReason)
      Deprecated.
      The finish reason (e.g., "stop").
    • toString

      public String toString()
      Deprecated.
      Overrides:
      toString in class Object
    • equals

      public boolean equals(Object o)
      Deprecated.
      Overrides:
      equals in class Object
    • canEqual

      protected boolean canEqual(Object other)
      Deprecated.
    • hashCode

      public int hashCode()
      Deprecated.
      Overrides:
      hashCode in class Object