pub struct DialogueSegment {
pub start_time: f64,
pub end_time: f64,
pub is_speech: bool,
pub confidence: f32,
}Expand description
Represents a segment of audio containing dialogue or silence.
Used by the audio synchronization system to identify speech patterns in audio files for subtitle timing alignment.
Fields§
§start_time: f64Start time of the segment in seconds
end_time: f64End time of the segment in seconds
is_speech: boolWhether this segment contains speech
confidence: f32Confidence level of the speech detection (0.0 to 1.0)
Implementations§
Source§impl DialogueSegment
impl DialogueSegment
Sourcepub fn new_speech(start: f64, end: f64) -> Self
pub fn new_speech(start: f64, end: f64) -> Self
Creates a new DialogueSegment representing a speech interval.
Sourcepub fn new_silence(start: f64, end: f64) -> Self
pub fn new_silence(start: f64, end: f64) -> Self
Creates a new DialogueSegment representing a silence interval.
Sourcepub fn overlaps_with(&self, other: &DialogueSegment) -> bool
pub fn overlaps_with(&self, other: &DialogueSegment) -> bool
Determines if this segment overlaps with another segment.
Sourcepub fn merge_with(&mut self, other: &DialogueSegment)
pub fn merge_with(&mut self, other: &DialogueSegment)
Merge with other segments of the same type, updating boundaries and confidence
Trait Implementations§
Source§impl Clone for DialogueSegment
impl Clone for DialogueSegment
Source§fn clone(&self) -> DialogueSegment
fn clone(&self) -> DialogueSegment
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for DialogueSegment
impl RefUnwindSafe for DialogueSegment
impl Send for DialogueSegment
impl Sync for DialogueSegment
impl Unpin for DialogueSegment
impl UnwindSafe for DialogueSegment
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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 moreSource§impl<F, T> IntoSample<T> for Fwhere
T: FromSample<F>,
impl<F, T> IntoSample<T> for Fwhere
T: FromSample<F>,
fn into_sample(self) -> T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.