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
or tts-1-hd
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
, echo
, fable
, onyx
, nova
, and shimmer
. Previews of the voices are available in the Text to speech guide.
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 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
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for CreateSpeechRequestArgs
impl Debug for CreateSpeechRequestArgs
Auto Trait Implementations§
impl Freeze for CreateSpeechRequestArgs
impl RefUnwindSafe for CreateSpeechRequestArgs
impl Send for CreateSpeechRequestArgs
impl Sync for CreateSpeechRequestArgs
impl Unpin for CreateSpeechRequestArgs
impl UnwindSafe for CreateSpeechRequestArgs
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more