Class AudioSpeechCreateParams
-
- All Implemented Interfaces:
-
com.openai.core.Params
public final class AudioSpeechCreateParams implements Params
Generates audio from the input text.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public final class
AudioSpeechCreateParams.Body
public final class
AudioSpeechCreateParams.Builder
A builder for AudioSpeechCreateParams.
public final class
AudioSpeechCreateParams.Voice
The voice to use when generating the audio. Supported voices are
alloy
,ash
,coral
,echo
,fable
,onyx
,nova
,sage
andshimmer
. Previews of the voices are available in the Text to speech guide.public final class
AudioSpeechCreateParams.ResponseFormat
The format to audio in. Supported formats are
mp3
,opus
,aac
,flac
,wav
, andpcm
.
-
Method Summary
Modifier and Type Method Description final String
input()
The text to generate audio for. final SpeechModel
model()
One of the available TTS models: tts-1
ortts-1-hd
final AudioSpeechCreateParams.Voice
voice()
The voice to use when generating the audio. final Optional<AudioSpeechCreateParams.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-1
ortts-1-hd
final JsonField<AudioSpeechCreateParams.Voice>
_voice()
The voice to use when generating the audio. final JsonField<AudioSpeechCreateParams.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 AudioSpeechCreateParams.Builder
toBuilder()
Boolean
equals(Object other)
Integer
hashCode()
String
toString()
final static AudioSpeechCreateParams.Builder
builder()
Returns a mutable builder for constructing an instance of AudioSpeechCreateParams. -
-
Method Detail
-
model
final SpeechModel model()
One of the available TTS models:
tts-1
ortts-1-hd
-
voice
final AudioSpeechCreateParams.Voice voice()
The voice to use when generating the audio. Supported voices are
alloy
,ash
,coral
,echo
,fable
,onyx
,nova
,sage
andshimmer
. Previews of the voices are available in the Text to speech guide.
-
responseFormat
final Optional<AudioSpeechCreateParams.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.25
to4.0
.1.0
is 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-1
ortts-1-hd
-
_voice
final JsonField<AudioSpeechCreateParams.Voice> _voice()
The voice to use when generating the audio. Supported voices are
alloy
,ash
,coral
,echo
,fable
,onyx
,nova
,sage
andshimmer
. Previews of the voices are available in the Text to speech guide.
-
_responseFormat
final JsonField<AudioSpeechCreateParams.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.25
to4.0
.1.0
is 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 AudioSpeechCreateParams.Builder toBuilder()
-
builder
final static AudioSpeechCreateParams.Builder builder()
Returns a mutable builder for constructing an instance of AudioSpeechCreateParams.
The following fields are required:
.input() .model() .voice()
-
-
-
-