pub struct CreateSpeechRequestArgs { /* private fields */ }Expand description
Builder for CreateSpeechRequest.
Implementations§
Source§impl CreateSpeechRequestArgs
impl CreateSpeechRequestArgs
Sourcepub fn input<VALUE: Into<String>>(&mut self, value: VALUE) -> &mut Self
pub fn input<VALUE: Into<String>>(&mut self, value: VALUE) -> &mut Self
The text to generate audio for. The maximum length is 4096 characters.
Sourcepub fn model<VALUE: Into<SpeechModel>>(&mut self, value: VALUE) -> &mut Self
pub fn model<VALUE: Into<SpeechModel>>(&mut self, value: VALUE) -> &mut Self
One of the available TTS models: tts-1,
tts-1-hd or gpt-4o-mini-tts.
Sourcepub fn voice<VALUE: Into<Voice>>(&mut self, value: VALUE) -> &mut Self
pub fn voice<VALUE: Into<Voice>>(&mut self, value: VALUE) -> &mut Self
The voice to use when generating the audio. Supported voices are alloy, ash, coral, echo, fable, onyx, nova, sage, shimmer and verse.
The voice to use when generating the audio. Supported voices are alloy, ash, ballad,
coral, echo, fable, onyx, nova, sage, shimmer, and verse. Previews of the voices
are available in the Text to speech guide.
Sourcepub fn instructions<VALUE: Into<String>>(&mut self, value: VALUE) -> &mut Self
pub fn instructions<VALUE: Into<String>>(&mut self, value: VALUE) -> &mut Self
Control the voice of your generated audio with additional instructions.
Does not work with tts-1 or tts-1-hd.
Sourcepub fn response_format<VALUE: Into<SpeechResponseFormat>>(
&mut self,
value: VALUE,
) -> &mut Self
pub fn response_format<VALUE: Into<SpeechResponseFormat>>( &mut self, value: VALUE, ) -> &mut Self
The format to audio in. Supported formats are mp3, opus, aac, flac, wav, and pcm.
Sourcepub fn speed<VALUE: Into<f32>>(&mut self, value: VALUE) -> &mut Self
pub fn speed<VALUE: Into<f32>>(&mut self, value: VALUE) -> &mut Self
The speed of the generated audio. Select a value from 0.25 to 4.0. 1.0 is the default.
Sourcepub fn stream_format<VALUE: Into<StreamFormat>>(
&mut self,
value: VALUE,
) -> &mut Self
pub fn stream_format<VALUE: Into<StreamFormat>>( &mut self, value: VALUE, ) -> &mut Self
The format to stream the audio in. Supported formats are sse and audio. sse is not
supported for tts-1 or tts-1-hd.
Sourcepub fn build(&self) -> Result<CreateSpeechRequest, OpenAIError>
pub fn build(&self) -> Result<CreateSpeechRequest, OpenAIError>
Trait Implementations§
Source§impl Clone for CreateSpeechRequestArgs
impl Clone for CreateSpeechRequestArgs
Source§fn clone(&self) -> CreateSpeechRequestArgs
fn clone(&self) -> CreateSpeechRequestArgs
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more