Skip to main content

Segmenter

Trait Segmenter 

Source
pub trait Segmenter: Send + Sync {
    // Required methods
    fn segment(
        &self,
        audio: &[f32],
    ) -> Result<Vec<RawSegment>, SegmentationError>;
    fn max_local_speakers(&self) -> usize;
    fn supports_overlap(&self) -> bool;
}
Expand description

A speaker segmentation engine — turns raw audio into spans of speech attributed to local speaker indices, with overlap detection.

Required Methods§

Source

fn segment(&self, audio: &[f32]) -> Result<Vec<RawSegment>, SegmentationError>

Segment audio. Audio must be 16 kHz mono f32 PCM.

Requires: audio.len() >= MIN_AUDIO_SAMPLES (1600 samples = 0.1s). Guarantees on Ok: segments are sorted by time.start; every local_speaker_idx < self.max_local_speakers(); timestamps lie within [0, audio.len() / 16000].

Source

fn max_local_speakers(&self) -> usize

Max number of distinct local speakers this implementation can output. powerset-3.0 ⇒ 3.

Source

fn supports_overlap(&self) -> bool

True if the implementation can detect overlap (two simultaneous speakers). powerset-3.0 ⇒ true.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§