Class SpeechCreateParams
-
- All Implemented Interfaces:
-
com.openai.core.Params
public final class SpeechCreateParams implements Params
Generates audio from the input text.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public final classSpeechCreateParams.Bodypublic final classSpeechCreateParams.BuilderA builder for SpeechCreateParams.
public final classSpeechCreateParams.VoiceThe voice to use when generating the audio. Supported voices are
alloy,ash,coral,echo,fable,onyx,nova,sageandshimmer. Previews of the voices are available in the Text to speech guide.public final classSpeechCreateParams.ResponseFormatThe format to audio in. Supported formats are
mp3,opus,aac,flac,wav, andpcm.
-
Method Summary
Modifier and Type Method Description final Stringinput()The text to generate audio for. final SpeechModelmodel()One of the available TTS models: tts-1ortts-1-hdfinal SpeechCreateParams.Voicevoice()The voice to use when generating the audio. final Optional<SpeechCreateParams.ResponseFormat>responseFormat()The format to audio in. final Optional<Double>speed()The speed of the generated audio. final JsonField<String>_input()The text to generate audio for. final JsonField<SpeechModel>_model()One of the available TTS models: tts-1ortts-1-hdfinal JsonField<SpeechCreateParams.Voice>_voice()The voice to use when generating the audio. final JsonField<SpeechCreateParams.ResponseFormat>_responseFormat()The format to audio in. final JsonField<Double>_speed()The speed of the generated audio. final Map<String, JsonValue>_additionalBodyProperties()final Headers_additionalHeaders()final QueryParams_additionalQueryParams()Headers_headers()The full set of headers in the parameters, including both fixed and additional headers. QueryParams_queryParams()The full set of query params in the parameters, including both fixed and additional query params. final SpeechCreateParams.BuildertoBuilder()Booleanequals(Object other)IntegerhashCode()StringtoString()final static SpeechCreateParams.Builderbuilder()Returns a mutable builder for constructing an instance of SpeechCreateParams. -
-
Method Detail
-
model
final SpeechModel model()
One of the available TTS models:
tts-1ortts-1-hd
-
voice
final SpeechCreateParams.Voice voice()
The voice to use when generating the audio. Supported voices are
alloy,ash,coral,echo,fable,onyx,nova,sageandshimmer. Previews of the voices are available in the Text to speech guide.
-
responseFormat
final Optional<SpeechCreateParams.ResponseFormat> responseFormat()
The format to audio in. Supported formats are
mp3,opus,aac,flac,wav, andpcm.
-
speed
final Optional<Double> speed()
The speed of the generated audio. Select a value from
0.25to4.0.1.0is the default.
-
_input
final JsonField<String> _input()
The text to generate audio for. The maximum length is 4096 characters.
-
_model
final JsonField<SpeechModel> _model()
One of the available TTS models:
tts-1ortts-1-hd
-
_voice
final JsonField<SpeechCreateParams.Voice> _voice()
The voice to use when generating the audio. Supported voices are
alloy,ash,coral,echo,fable,onyx,nova,sageandshimmer. Previews of the voices are available in the Text to speech guide.
-
_responseFormat
final JsonField<SpeechCreateParams.ResponseFormat> _responseFormat()
The format to audio in. Supported formats are
mp3,opus,aac,flac,wav, andpcm.
-
_speed
final JsonField<Double> _speed()
The speed of the generated audio. Select a value from
0.25to4.0.1.0is the default.
-
_additionalBodyProperties
final Map<String, JsonValue> _additionalBodyProperties()
-
_additionalHeaders
final Headers _additionalHeaders()
-
_additionalQueryParams
final QueryParams _additionalQueryParams()
-
_headers
Headers _headers()
The full set of headers in the parameters, including both fixed and additional headers.
-
_queryParams
QueryParams _queryParams()
The full set of query params in the parameters, including both fixed and additional query params.
-
toBuilder
final SpeechCreateParams.Builder toBuilder()
-
builder
final static SpeechCreateParams.Builder builder()
Returns a mutable builder for constructing an instance of SpeechCreateParams.
The following fields are required:
.input() .model() .voice()
-
-
-
-