pub struct Diarizer<E> { /* private fields */ }Expand description
An embedding engine with enrolled profiles and anonymous voice clusters.
Implementations§
Source§impl<E: Embedder> Diarizer<E>
impl<E: Embedder> Diarizer<E>
Sourcepub fn new(embedder: E, enrolled: Vec<Profile>) -> Self
pub fn new(embedder: E, enrolled: Vec<Profile>) -> Self
A diarizer over an engine the caller already loaded.
Sourcepub fn embed(&mut self, window: &[f32]) -> Option<Vec<f32>>
pub fn embed(&mut self, window: &[f32]) -> Option<Vec<f32>>
A unit-norm embedding for one segment’s audio window, or None when
none can be trusted. A broken model degrades the same way a quiet
window does, one warning apart.
Sourcepub fn label(&mut self, embedding: &[f32], speaking: Option<&str>) -> String
pub fn label(&mut self, embedding: &[f32], speaking: Option<&str>) -> String
The live, tentative label for an embedding. speaking is the label
the previous segment was given, which holds unless this one clearly
belongs elsewhere.
Sourcepub fn set_enrolled(&mut self, enrolled: Vec<Profile>)
pub fn set_enrolled(&mut self, enrolled: Vec<Profile>)
Replaces the enrolled profiles, keeping the loaded model. A voice enrolled since this diarizer opened is invisible until this is called.
Sourcepub fn owners(&self) -> usize
pub fn owners(&self) -> usize
How many enrolled profiles belong to the machine’s owner. Zero means nothing can answer “was that you?”.
Sourcepub fn enrolled_name(&self, embedding: &[f32]) -> Option<String>
pub fn enrolled_name(&self, embedding: &[f32]) -> Option<String>
The enrolled name this embedding matches. Unlike Diarizer::label,
it never opens or grows an anonymous cluster.