Skip to main content

VoiceprintTracker

Struct VoiceprintTracker 

Source
pub struct VoiceprintTracker<'a, E, S = NoSegmenter> { /* private fields */ }
Available on crate feature silero and non-target_family=wasm only.
Expand description

Cuts one recording into turns and judges each one. The diarizer scores whose voice a window is. The segmenter, when there is one, checks a speaker change inside a turn before the turn splits, which owner-only admission needs.

Implementations§

Source§

impl<'a, E: Embedder> VoiceprintTracker<'a, E>

Source

pub fn new(diarizer: &'a mut Diarizer<E>, at: u64) -> Self

A tracker that names enrolled voices but cannot admit only the owner. The first sample heard sits at at.

Source

pub fn numbering(diarizer: &'a mut Diarizer<E>, at: u64) -> Self

A tracker that labels every voice, numbering those nobody enrolled. It has no segmenter, so a speaker change splits a turn unchecked.

Source§

impl<'a, E: Embedder, S: Segmenter> VoiceprintTracker<'a, E, S>

Source

pub fn owner_only( diarizer: &'a mut Diarizer<E>, segmenter: S, at: u64, ) -> Result<Self, OwnerTrackingError>

A tracker that can admit only the owner’s words: it needs an enrolled owner, and a segmenter to check speaker changes.

Trait Implementations§

Source§

impl<E: Embedder, S: Segmenter> SpeakerTracker for VoiceprintTracker<'_, E, S>

Source§

fn heard_to(&self) -> u64

Where the next sample heard sits.
Source§

fn hear(&mut self, speech: &SpeechMap, audio: &[f32])

Takes the audio after what it has heard.
Source§

fn skip_to(&mut self, speech: &SpeechMap, at: u64)

Gives up on the audio before at, which it will never hear.
Source§

fn finish(&mut self)

Judges what is still open. Call once the recording ends.
Source§

fn timeline(&self) -> &Timeline

Source§

fn forget_before(&mut self, at: u64) -> u64

Forgets the timeline before at, or before the open turn’s start when that comes first. Returns how far the speech map may be forgotten: never past what the tracker still reads from it.

Auto Trait Implementations§

§

impl<'a, E, S = NoSegmenter> !UnwindSafe for VoiceprintTracker<'a, E, S>

§

impl<'a, E, S> Freeze for VoiceprintTracker<'a, E, S>
where &'a mut Diarizer<E>: Freeze, Option<Continuity<S>>: Freeze,

§

impl<'a, E, S> RefUnwindSafe for VoiceprintTracker<'a, E, S>
where &'a mut Diarizer<E>: RefUnwindSafe, Option<Continuity<S>>: RefUnwindSafe,

§

impl<'a, E, S> Send for VoiceprintTracker<'a, E, S>
where &'a mut Diarizer<E>: Send, Option<Continuity<S>>: Send,

§

impl<'a, E, S> Sync for VoiceprintTracker<'a, E, S>
where &'a mut Diarizer<E>: Sync, Option<Continuity<S>>: Sync,

§

impl<'a, E, S> Unpin for VoiceprintTracker<'a, E, S>
where &'a mut Diarizer<E>: Unpin, Option<Continuity<S>>: Unpin,

§

impl<'a, E, S> UnsafeUnpin for VoiceprintTracker<'a, E, S>
where &'a mut Diarizer<E>: UnsafeUnpin, Option<Continuity<S>>: UnsafeUnpin,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<S, T> Duplex<S> for T
where T: FromSample<S> + ToSample<S>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<S> FromSample<S> for S

Source§

fn from_sample_(s: S) -> S

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> ToSample<U> for T
where U: FromSample<T>,

Source§

fn to_sample_(self) -> U

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more