Class HttpSpeechSynthesisParam


@Deprecated public class HttpSpeechSynthesisParam extends HalfDuplexServiceParam
Deprecated.
HTTP TTS (Text-to-Speech) synthesis parameter class. Supports HTTP SSE-based speech synthesis API calls for models like CosyVoice.

Example usage:


 HttpSpeechSynthesisParam param = HttpSpeechSynthesisParam.builder()
     .model("cosyvoice-v3-flash")
     .text("Hello, welcome to the text-to-speech service.")
     .voice("longanyang")
     .format("wav")
     .sampleRate(24000)
     .build();
 
Author:
DashScope SDK Team
  • Constructor Details

  • Method Details

    • getHttpBody

      public com.google.gson.JsonObject getHttpBody()
      Deprecated.
      Description copied from class: HalfDuplexParamBase
      Get the batch request data. Http body include {"model": "model_name", "input": "input data", "parameters": "The request parameters"}
      Specified by:
      getHttpBody in class HalfDuplexParamBase
      Returns:
      The http request body
    • getInput

      public Object getInput()
      Deprecated.
      Description copied from class: HalfDuplexParamBase
      Get the request input data.
      Specified by:
      getInput in class HalfDuplexParamBase
      Returns:
      The input data object.
    • getBinaryData

      public ByteBuffer getBinaryData()
      Deprecated.
      Description copied from class: HalfDuplexParamBase
      Get the binary data, only websocket, if no binary data, return null.
      Specified by:
      getBinaryData in class HalfDuplexParamBase
      Returns:
      The binary data
    • validate

      public void validate() throws InputRequiredException
      Deprecated.
      Description copied from class: HalfDuplexParamBase
      Validate the input and parameters.
      Specified by:
      validate in class HalfDuplexParamBase
      Throws:
      InputRequiredException - Missing input fields.
    • builder

      Deprecated.
    • getText

      @NonNull public @NonNull String getText()
      Deprecated.
      The text to be synthesized into speech.
    • getVoice

      public String getVoice()
      Deprecated.
      The voice name for synthesis (e.g., "longanyang", "longxiaochun").
    • getFormat

      public String getFormat()
      Deprecated.
      The audio format (e.g., "wav", "mp3", "pcm").
    • getSampleRate

      public Integer getSampleRate()
      Deprecated.
      The sample rate in Hz (e.g., 8000, 16000, 24000, 48000).
    • getVolume

      public Integer getVolume()
      Deprecated.
      The audio volume (0-100).
    • getRate

      public Float getRate()
      Deprecated.
      The speech rate (0.5-2.0).
    • getPitch

      public Float getPitch()
      Deprecated.
      The pitch rate (0.5-2.0).
    • setText

      public void setText(@NonNull @NonNull String text)
      Deprecated.
      The text to be synthesized into speech.
    • setVoice

      public void setVoice(String voice)
      Deprecated.
      The voice name for synthesis (e.g., "longanyang", "longxiaochun").
    • setFormat

      public void setFormat(String format)
      Deprecated.
      The audio format (e.g., "wav", "mp3", "pcm").
    • setSampleRate

      public void setSampleRate(Integer sampleRate)
      Deprecated.
      The sample rate in Hz (e.g., 8000, 16000, 24000, 48000).
    • setVolume

      public void setVolume(Integer volume)
      Deprecated.
      The audio volume (0-100).
    • setRate

      public void setRate(Float rate)
      Deprecated.
      The speech rate (0.5-2.0).
    • setPitch

      public void setPitch(Float pitch)
      Deprecated.
      The pitch rate (0.5-2.0).
    • toString

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

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

      protected boolean canEqual(Object other)
      Deprecated.
      Overrides:
      canEqual in class HalfDuplexServiceParam
    • hashCode

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