pub trait Segmenter {
// Required methods
fn shape(&self) -> ChunkShape;
fn segment(
&mut self,
chunk: &[f32],
) -> Result<Vec<Activity>, SegmentationError>;
}Expand description
Speakers active in each frame of one fixed-width chunk of audio.
Implementations map their own failures through
BackendError::engine and name
themselves with Engine::NAME.
Required Methods§
Sourcefn shape(&self) -> ChunkShape
fn shape(&self) -> ChunkShape
The chunk width this engine reads and the frame grid it answers on. Fixed for the life of the engine — it is a property of the graph.
Sourcefn segment(&mut self, chunk: &[f32]) -> Result<Vec<Activity>, SegmentationError>
fn segment(&mut self, chunk: &[f32]) -> Result<Vec<Activity>, SegmentationError>
Who speaks in each frame of chunk, which must be exactly
ChunkShape::samples long. A caller with less audio than that pads
it; a caller with more cuts it.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementations on Foreign Types§
Implementors§
impl Segmenter for NoSegmenter
Available on crate feature
silero and non-target_family=wasm only.