pub struct Audio { /* private fields */ }Expand description
Accessor for audio endpoints: client.audio().speech(...).
Implementations§
Source§impl Audio
impl Audio
Sourcepub async fn speech(&self, request: SpeechRequest) -> Result<Bytes, OpenAIError>
pub async fn speech(&self, request: SpeechRequest) -> Result<Bytes, OpenAIError>
Text-to-speech: returns the raw audio bytes.
Sourcepub async fn transcriptions(
&self,
file: FileUpload,
request: TranscriptionRequest,
) -> Result<Transcription, OpenAIError>
pub async fn transcriptions( &self, file: FileUpload, request: TranscriptionRequest, ) -> Result<Transcription, OpenAIError>
Speech-to-text: transcribe an audio file (multipart upload).
Parses the JSON response shapes (response_format of json, the
default, or verbose_json). For the plain-text formats (text,
srt, vtt) use Audio::transcriptions_raw.
Sourcepub async fn transcriptions_raw(
&self,
file: FileUpload,
request: TranscriptionRequest,
) -> Result<String, OpenAIError>
pub async fn transcriptions_raw( &self, file: FileUpload, request: TranscriptionRequest, ) -> Result<String, OpenAIError>
Speech-to-text returning the raw response body as text — for the
non-JSON response_formats (text, srt, vtt).
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Audio
impl !UnwindSafe for Audio
impl Freeze for Audio
impl Send for Audio
impl Sync for Audio
impl Unpin for Audio
impl UnsafeUnpin for Audio
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