pub struct SpeechRequestBuilder { /* private fields */ }
Expand description
Builder for SpeechRequest
.
Implementations§
Source§impl SpeechRequestBuilder
impl SpeechRequestBuilder
Sourcepub fn model(&mut self, value: SpeechModel) -> &mut Self
pub fn model(&mut self, value: SpeechModel) -> &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(&mut self, value: SpeechVoice) -> &mut Self
pub fn voice(&mut self, value: SpeechVoice) -> &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(&mut self, value: SpeechResponseFormat) -> &mut Self
pub fn response_format(&mut self, value: SpeechResponseFormat) -> &mut Self
The format to audio in. Supported formats are mp3, opus, aac, and flac.
Sourcepub fn speed(&mut self, value: f32) -> &mut Self
pub fn speed(&mut self, value: f32) -> &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<SpeechRequest, SpeechRequestBuilderError>
pub fn build(&self) -> Result<SpeechRequest, SpeechRequestBuilderError>
Trait Implementations§
Source§impl Clone for SpeechRequestBuilder
impl Clone for SpeechRequestBuilder
Source§fn clone(&self) -> SpeechRequestBuilder
fn clone(&self) -> SpeechRequestBuilder
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 moreAuto Trait Implementations§
impl Freeze for SpeechRequestBuilder
impl RefUnwindSafe for SpeechRequestBuilder
impl Send for SpeechRequestBuilder
impl Sync for SpeechRequestBuilder
impl Unpin for SpeechRequestBuilder
impl UnwindSafe for SpeechRequestBuilder
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