pub struct SyncEngine { /* private fields */ }Expand description
Unified sync engine based on VAD voice detection.
This engine provides automatic subtitle synchronization using Voice Activity Detection (VAD) to analyze audio tracks and calculate optimal sync offsets.
Implementations§
Source§impl SyncEngine
impl SyncEngine
Sourcepub fn new(config: SyncConfig) -> Result<Self>
pub fn new(config: SyncConfig) -> Result<Self>
Sourcepub async fn detect_sync_offset(
&self,
audio_path: &Path,
subtitle: &Subtitle,
method: Option<SyncMethod>,
) -> Result<SyncResult>
pub async fn detect_sync_offset( &self, audio_path: &Path, subtitle: &Subtitle, method: Option<SyncMethod>, ) -> Result<SyncResult>
Sourcepub fn apply_manual_offset(
&self,
subtitle: &mut Subtitle,
offset_seconds: f32,
) -> Result<SyncResult>
pub fn apply_manual_offset( &self, subtitle: &mut Subtitle, offset_seconds: f32, ) -> Result<SyncResult>
Apply manual offset to subtitle timing.
§Arguments
subtitle- Mutable subtitle data to modifyoffset_seconds- Offset in seconds (positive delays, negative advances)
§Returns
Sync result with the applied offset and full confidence.
§Errors
Returns an error if the offset exceeds the configured maximum.
Auto Trait Implementations§
impl Freeze for SyncEngine
impl RefUnwindSafe for SyncEngine
impl Send for SyncEngine
impl Sync for SyncEngine
impl Unpin for SyncEngine
impl UnwindSafe for SyncEngine
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