pub struct TranscriptionLoader { /* private fields */ }Expand description
Loader that handles media files via sidecar subtitle detection and whisper-apr-based speech-to-text transcription.
When a media file has a sidecar subtitle (.srt or .vtt) adjacent to it,
the subtitle is loaded directly. Otherwise, the audio is decoded and
transcribed using the whisper-apr Whisper ASR engine.
§Example
use aprender_rag::loader::transcription::{TranscriptionLoader, TranscriptionConfig};
use aprender_rag::loader::LoaderRegistry;
let mut registry = LoaderRegistry::new();
registry.register(Box::new(TranscriptionLoader::with_defaults()));
// Now the registry handles .mp4, .wav, etc. via sidecar detectionImplementations§
Source§impl TranscriptionLoader
impl TranscriptionLoader
Sourcepub fn new(config: TranscriptionConfig) -> Self
pub fn new(config: TranscriptionConfig) -> Self
Create a new transcription loader with the given configuration.
If config.model_path is set, loads the whisper-apr model eagerly.
Otherwise, transcription of files without sidecars will fail gracefully.
Sourcepub fn with_defaults() -> Self
pub fn with_defaults() -> Self
Create a loader with default configuration (no model loaded).
Sourcepub fn config(&self) -> &TranscriptionConfig
pub fn config(&self) -> &TranscriptionConfig
Access the transcription configuration.
Trait Implementations§
Source§impl Debug for TranscriptionLoader
impl Debug for TranscriptionLoader
Source§impl DocumentLoader for TranscriptionLoader
impl DocumentLoader for TranscriptionLoader
Source§fn supported_extensions(&self) -> Vec<&str>
fn supported_extensions(&self) -> Vec<&str>
File extensions this loader handles (lowercase, without dot).
Auto Trait Implementations§
impl Freeze for TranscriptionLoader
impl RefUnwindSafe for TranscriptionLoader
impl Send for TranscriptionLoader
impl Sync for TranscriptionLoader
impl Unpin for TranscriptionLoader
impl UnsafeUnpin for TranscriptionLoader
impl UnwindSafe for TranscriptionLoader
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more