pub struct AudioSpeechRequest {
pub model: String,
pub input: String,
pub voice: String,
pub output: String,
}
Expand description
Represents a request for text-to-speech synthesis.
Fields§
§model: String
Model to be used for speech synthesis.
input: String
Input text to be synthesized.
voice: String
Voice model to be used for the synthesis.
output: String
Output format for the synthesized speech.
Implementations§
Source§impl AudioSpeechRequest
impl AudioSpeechRequest
Sourcepub fn new(model: String, input: String, voice: String, output: String) -> Self
pub fn new(model: String, input: String, voice: String, output: String) -> Self
Creates a new AudioSpeechRequest
with the specified model, input, voice, and output format.
Examples found in repository?
examples/text_to_speech.rs (lines 8-13)
5async fn main() -> Result<(), Box<dyn std::error::Error>> {
6 let client = Client::from_env().unwrap();
7
8 let req = AudioSpeechRequest::new(
9 TTS_1.to_string(),
10 String::from("Money is not problem, Problem is no money"),
11 audio::VOICE_ALLOY.to_string(),
12 String::from("problem.mp3"),
13 );
14
15 let result = client.audio_speech(req).await?;
16 println!("{:?}", result);
17
18 Ok(())
19}
Trait Implementations§
Source§impl Clone for AudioSpeechRequest
impl Clone for AudioSpeechRequest
Source§fn clone(&self) -> AudioSpeechRequest
fn clone(&self) -> AudioSpeechRequest
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 AudioSpeechRequest
impl Debug for AudioSpeechRequest
Auto Trait Implementations§
impl Freeze for AudioSpeechRequest
impl RefUnwindSafe for AudioSpeechRequest
impl Send for AudioSpeechRequest
impl Sync for AudioSpeechRequest
impl Unpin for AudioSpeechRequest
impl UnwindSafe for AudioSpeechRequest
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