client sdk
This commit is contained in:
+6
-2
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user