pub struct SyncConfig {
pub default_method: String,
pub max_offset_seconds: f32,
pub vad: VadConfig,
pub correlation_threshold: f32,
pub dialogue_detection_threshold: f32,
pub min_dialogue_duration_ms: u32,
pub dialogue_merge_gap_ms: u32,
pub enable_dialogue_detection: bool,
pub audio_sample_rate: u32,
pub auto_detect_sample_rate: bool,
}Expand description
Audio synchronization configuration supporting VAD speech detection.
This configuration struct defines settings for subtitle-audio synchronization, including method selection, timing constraints, and VAD-specific parameters.
Fields§
§default_method: StringDefault synchronization method (“vad”, “auto”)
max_offset_seconds: f32Maximum allowed time offset in seconds
vad: VadConfigLocal VAD related settings
correlation_threshold: f32Deprecated: correlation threshold for audio analysis
dialogue_detection_threshold: f32Deprecated: dialogue detection threshold
min_dialogue_duration_ms: u32Deprecated: minimum dialogue duration in milliseconds
dialogue_merge_gap_ms: u32Deprecated: dialogue merge gap in milliseconds
enable_dialogue_detection: boolDeprecated: enable dialogue detection flag
audio_sample_rate: u32Deprecated: audio sample rate
auto_detect_sample_rate: boolDeprecated: auto-detect sample rate flag
Implementations§
Source§impl SyncConfig
impl SyncConfig
Sourcepub fn validate(&self) -> Result<()>
pub fn validate(&self) -> Result<()>
Validate the sync configuration for correctness.
Checks all sync-related configuration parameters to ensure they are within valid ranges and have acceptable values.
§Returns
Returns Ok(()) if validation passes, or an error describing
the validation failure.
§Errors
This function returns an error if:
default_methodis not one of the supported methodsmax_offset_secondsis outside the valid range- VAD configuration validation fails
Trait Implementations§
Source§impl Clone for SyncConfig
impl Clone for SyncConfig
Source§fn clone(&self) -> SyncConfig
fn clone(&self) -> SyncConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more