pub struct SegmentLabeler<E> { /* private fields */ }silero and non-target_family=wasm only.Implementations§
Source§impl<E: Embedder> SegmentLabeler<E>
impl<E: Embedder> SegmentLabeler<E>
pub fn new(vad: Option<SileroVad>, diarizer: Option<Diarizer<E>>) -> Self
Sourcepub fn diarizes(&self) -> bool
pub fn diarizes(&self) -> bool
Whether a speaker model loaded — without one every label is None
and a final relabel has nothing to say.
Sourcepub fn set_only_own_voice(&mut self, only_own_voice: bool)
pub fn set_only_own_voice(&mut self, only_own_voice: bool)
Keeps out segments in a voice that is not the owner’s, judged over the turn so far. Without a speaker model nothing can be judged and everything stays.
pub fn only_own_voice(&self) -> bool
Sourcepub fn judges_own_voice(&self) -> bool
pub fn judges_own_voice(&self) -> bool
Whether a stranger’s voice is actually kept out: the setting is on and there is a model with an owner to judge by. The setting alone promises nothing.
Sourcepub fn set_enrolled(&mut self, enrolled: Vec<Profile>)
pub fn set_enrolled(&mut self, enrolled: Vec<Profile>)
Replaces the enrolled profiles the diarizer judges against. Without a speaker model there is nothing to hold them.
Sourcepub fn own_voice_audio(&mut self, samples: &[f32]) -> Option<Vec<f32>>
pub fn own_voice_audio(&mut self, samples: &[f32]) -> Option<Vec<f32>>
The stretches of a finished recording in the owner’s voice, joined in
order: what a decode that hears everything at once should be handed.
Turns are cut and judged as the live path cuts and judges them. None
when everything stays: not keeping strangers out, or no speaker model
to judge by.
Sourcepub fn observe(&mut self, window: &[f32], silence_before: u64) -> Verdict
pub fn observe(&mut self, window: &[f32], silence_before: u64) -> Verdict
silence_before is the samples of gap between the previous segment’s
audio and this one’s; zero whenever the timing is unknown. With a
speech gate the window’s own silence counts too, since an engine’s
timings can stretch a word over a pause.