client sdk

This commit is contained in:
valenti
2026-10-21 17:56:04 +01:00
parent 1cafe3dd3c
commit d6bc2437c9
237 changed files with 5227 additions and 1019 deletions
+6 -2
View File
@@ -65,7 +65,8 @@ impl SileroVad {
// Introspect the recurrent-state and sample-rate inputs so we build
// tensors matching the exported graph instead of hardcoding shapes.
let state_shape = declared_shape(&session, IN_STATE).unwrap_or_else(|_| STATE_SHAPE.to_vec());
let state_shape =
declared_shape(&session, IN_STATE).unwrap_or_else(|_| STATE_SHAPE.to_vec());
let sr_rank = declared_shape(&session, IN_SR)
.map(|s| s.len())
.unwrap_or(0);
@@ -100,7 +101,10 @@ impl SileroVad {
/// window (zeros on the first call).
fn probability(&self, state: &mut [f32], context: &[f32], window: &[f32]) -> Result<f32> {
if window.len() != WINDOW_SAMPLES {
bail!("VAD window must be {WINDOW_SAMPLES} samples, got {}", window.len());
bail!(
"VAD window must be {WINDOW_SAMPLES} samples, got {}",
window.len()
);
}
let mut input = Vec::with_capacity(CONTEXT_SAMPLES + WINDOW_SAMPLES);