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],
) -> Result<Option<Vec<f32>>, SpeakerError>
pub fn embed( &mut self, window: &[f32], ) -> Result<Option<Vec<f32>>, SpeakerError>
A unit-norm embedding for one segment’s audio window, or None when
the window holds too little voice to trust.
Sourcepub fn label(&mut self, embedding: &[f32], speaking: Option<&Label>) -> Label
pub fn label(&mut self, embedding: &[f32], speaking: Option<&Label>) -> Label
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.
Auto Trait Implementations§
impl<E> Freeze for Diarizer<E>where
E: Freeze,
impl<E> RefUnwindSafe for Diarizer<E>where
E: RefUnwindSafe,
impl<E> Send for Diarizer<E>where
E: Send,
impl<E> Sync for Diarizer<E>where
E: Sync,
impl<E> Unpin for Diarizer<E>where
E: Unpin,
impl<E> UnsafeUnpin for Diarizer<E>where
E: UnsafeUnpin,
impl<E> UnwindSafe for Diarizer<E>where
E: UnwindSafe,
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