pub struct CreateSpeechRequestBuilder { /* private fields */ }
Expand description
Builder for CreateSpeechRequest
.
Implementations§
Source§impl CreateSpeechRequestBuilder
impl CreateSpeechRequestBuilder
Sourcepub fn model<VALUE: Into<AudioSpeechModel>>(
&mut self,
value: VALUE,
) -> &mut Self
pub fn model<VALUE: Into<AudioSpeechModel>>( &mut self, value: VALUE, ) -> &mut Self
One of the available TTS models: tts-1
or tts-1-hd
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 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<SttResponseFormat>>(
&mut self,
value: VALUE,
) -> &mut Self
pub fn response_format<VALUE: Into<SttResponseFormat>>( &mut self, value: VALUE, ) -> &mut Self
The format to audio in. Supported formats are mp3
, opus
, aac
, flac
, wav
, and pcm
.
#[serde(skip_serializing_if = “Option::is_none”)]
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 CreateSpeechRequestBuilder
impl Clone for CreateSpeechRequestBuilder
Source§fn clone(&self) -> CreateSpeechRequestBuilder
fn clone(&self) -> CreateSpeechRequestBuilder
Returns a copy 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 CreateSpeechRequestBuilder
impl Debug for CreateSpeechRequestBuilder
Auto Trait Implementations§
impl Freeze for CreateSpeechRequestBuilder
impl RefUnwindSafe for CreateSpeechRequestBuilder
impl Send for CreateSpeechRequestBuilder
impl Sync for CreateSpeechRequestBuilder
impl Unpin for CreateSpeechRequestBuilder
impl UnwindSafe for CreateSpeechRequestBuilder
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