pub struct Transcriber { /* private fields */ }Expand description
Transcribes audio by POSTing it to a configured Endpoint.
Implementations§
Source§impl Transcriber
impl Transcriber
Sourcepub fn new(endpoint: Endpoint) -> Self
pub fn new(endpoint: Endpoint) -> Self
Build a transcriber for the given endpoint, defaulting to Arabic and a
DEFAULT_TIMEOUT_SECS total-request timeout.
Sourcepub fn with_timeout(endpoint: Endpoint, timeout: Duration) -> Self
pub fn with_timeout(endpoint: Endpoint, timeout: Duration) -> Self
Like new but with an explicit total-request timeout — raise it
for slow CPU inference or large files, lower it to fail faster. The timeout
spans the whole round-trip (connect + upload + inference + download).
Sourcepub fn language(self, lang: impl Into<String>) -> Self
pub fn language(self, lang: impl Into<String>) -> Self
Override the transcription language (ISO-639-1).
Sourcepub fn transcribe(&self, audio: &Path) -> Result<Transcript>
pub fn transcribe(&self, audio: &Path) -> Result<Transcript>
Read audio, send it to the endpoint, and return the transcript.
Auto Trait Implementations§
impl !RefUnwindSafe for Transcriber
impl !UnwindSafe for Transcriber
impl Freeze for Transcriber
impl Send for Transcriber
impl Sync for Transcriber
impl Unpin for Transcriber
impl UnsafeUnpin for Transcriber
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