Class SpeechGenerationOptions

java.lang.Object
com.azure.ai.openai.models.SpeechGenerationOptions

public final class SpeechGenerationOptions extends Object
A representation of the request options that control the behavior of a text-to-speech operation.
  • Constructor Details

    • SpeechGenerationOptions

      public SpeechGenerationOptions(String input, SpeechVoice voice)
      Creates an instance of SpeechGenerationOptions class.
      Parameters:
      input - the input value to set.
      voice - the voice value to set.
  • Method Details

    • getInput

      public String getInput()
      Get the input property: The text to generate audio for. The maximum length is 4096 characters.
      Returns:
      the input value.
    • getVoice

      public SpeechVoice getVoice()
      Get the voice property: The voice to use for text-to-speech.
      Returns:
      the voice value.
    • getResponseFormat

      public SpeechGenerationResponseFormat getResponseFormat()
      Get the responseFormat property: The audio output format for the spoken text. By default, the MP3 format will be used.
      Returns:
      the responseFormat value.
    • setResponseFormat

      public SpeechGenerationOptions setResponseFormat(SpeechGenerationResponseFormat responseFormat)
      Set the responseFormat property: The audio output format for the spoken text. By default, the MP3 format will be used.
      Parameters:
      responseFormat - the responseFormat value to set.
      Returns:
      the SpeechGenerationOptions object itself.
    • getSpeed

      public Double getSpeed()
      Get the speed property: The speed of speech for generated audio. Values are valid in the range from 0.25 to 4.0, with 1.0 the default and higher values corresponding to faster speech.
      Returns:
      the speed value.
    • setSpeed

      public SpeechGenerationOptions setSpeed(Double speed)
      Set the speed property: The speed of speech for generated audio. Values are valid in the range from 0.25 to 4.0, with 1.0 the default and higher values corresponding to faster speech.
      Parameters:
      speed - the speed value to set.
      Returns:
      the SpeechGenerationOptions object itself.
    • getModel

      public String getModel()
      Get the model property: The model to use for this text-to-speech request.
      Returns:
      the model value.
    • setModel

      public SpeechGenerationOptions setModel(String model)
      Set the model property: The model to use for this text-to-speech request.
      Parameters:
      model - the model value to set.
      Returns:
      the SpeechGenerationOptions object itself.