pub trait Embedder {
// Required methods
fn embed(
&mut self,
window: &[f32],
) -> Result<Option<Vec<f32>>, SpeakerError>;
fn dimension(&self) -> usize;
}Expand description
Turns audio into a comparable voice vector.
Implementations map their own failures through
BackendError::engine and name
themselves with Engine::NAME.
Required Methods§
Sourcefn embed(&mut self, window: &[f32]) -> Result<Option<Vec<f32>>, SpeakerError>
fn embed(&mut self, window: &[f32]) -> Result<Option<Vec<f32>>, SpeakerError>
A unit-norm embedding for one window of 16 kHz samples.
Ok(None) means the window carried no voice worth embedding — too
short, or too quiet. That is an ordinary answer, not a failure, and a
caller usually keeps whatever label it already had. Err means the
model itself broke.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".