Skip to main content

Module speaker

Module speaker 

Source
Expand description

Who is speaking, as a vector: the contract every speaker-embedding engine implements.

An engine turns a window of 16 kHz samples into a unit-norm embedding. Two embeddings of one voice point the same way, so their cosine says whether two stretches of speech came from the same person. What to do with that number is policy, kept out of every engine: Diarizer groups voices and claims enrolled names, SegmentReader applies it to the segments a transcription session emits, and PyannoteVoices reads who spoke when from the audio itself, beside the transcriber.

Structs§

Chunk
Model outputs for one chunk, reusable across clustering threshold sweeps.
Diarizer
An embedding engine with enrolled profiles and anonymous voice clusters.
EnrolledNon-target_family=wasm
A finished enrollment: the profile to store, and the score worth showing the person who just recorded it.
EnrollmentNon-target_family=wasm
Samples gathered so far, and the engine that measures them.
Grouping
Clustering thresholds, adjustable without rerunning model inference.
Heardsilero and non-target_family=wasm
One finalized segment, as the labeler judged it.
Merged
A voice that turned out to be one already heard.
Profile
One enrolled voice.
ProfileStoreNon-target_family=wasm
The directory of enrolled voices.
PyannoteVoices
Revision
What an observation changed about names already written.
SegmentLabelersilero and non-target_family=wasm
SegmentReadersilero and non-target_family=wasm
Walks the finalized segments of one recording: cuts each segment’s audio out of the window, labels it, and frees what no reader needs any more.
SpeakerName
An enrolled person’s name, which is also their filename. Holding one is proof it cannot escape the speakers directory.
Spoken
One stretch of the recording, and whose voice was in it.
Standing
One voice as it stands right now, for a caller watching a session settle.
StoredProfilesNon-target_family=wasm
Voiceprint
What one local voice sounded like, embedded through its own frame mask.

Enums§

EnrollmentErrorNon-target_family=wasm
HeardUpdatesilero and non-target_family=wasm
Label
An enrolled person, or a voice nobody enrolled, numbered in the order it was first heard.
ProfileErrorNon-target_family=wasm
ReplaceNon-target_family=wasm
Whether storing a profile may overwrite one already there.
Role
What an enrolled voice is allowed to be. Only an owner’s voice answers “was that you?”, so a guest can be recognized by name without turning on dictation meant for the person who set the machine up.
SpeakerError
SpeakerNameError
Verdictsilero and non-target_family=wasm

Constants§

CLUSTER_THRESHOLD
Similarity threshold for anonymous clusters; short audio windows need a lower gate.
ENROLLED_THRESHOLD
Minimum similarity for claiming an enrolled name.
MIN_SAMPLESNon-target_family=wasm
Below two samples there is nothing to average and no disagreement to measure.
OWN_VOICE_THRESHOLDsilero and non-target_family=wasm
Owner-match threshold below the naming gate to allow short turns. Calibrated on one voice and one synthetic alternative.

Traits§

Embedder
Turns audio into a comparable voice vector.
Engine
How an engine is constructed from its own configuration. NAME names the engine in stored profiles and errors; Config carries whatever it needs to load.
Voices
A running account of who is speaking in a recording.

Functions§

attribute_spans
Asks a track who owned each paragraph, skipping the ones nobody timed.
centroidNon-target_family=wasm
Normalizes the elementwise mean of unit-length embeddings. Returns None when the mean has no direction.
consistencyNon-target_family=wasm
Mean pairwise cosine similarity of unit-length embeddings.
normalized
Scales a vector to unit length, so cosines are plain dot products. None when the vector has no direction to keep.
settle
Fills missing labels from neighboring speakers. Utterance openings prefer the following label; other gaps prefer the preceding one. All-None input stays unchanged.
validate_model_fileNon-target_family=wasm
crate::backend::validate_model_file, failing as a SpeakerError.