@@ -244,12 +244,16 @@ pub enum TTSConfig {
244244
245245#[ derive( Debug , Clone , serde:: Serialize , serde:: Deserialize ) ]
246246pub struct SileroVadconfig {
247+ #[ serde( default = "SileroVadconfig::default_threshold" ) ]
247248 pub threshold : f32 ,
249+ #[ serde( default = "SileroVadconfig::default_neg_threshold" ) ]
248250 pub neg_threshold : Option < f32 > ,
249-
251+ # [ serde ( default = "SileroVadconfig::default_min_speech_duration_ms" ) ]
250252 pub min_speech_duration_ms : usize ,
253+ #[ serde( default = "SileroVadconfig::default_max_silence_duration_ms" ) ]
251254 pub max_silence_duration_ms : usize ,
252- pub audio_cache_ms : usize ,
255+ #[ serde( default = "SileroVadconfig::hangover_ms" ) ]
256+ pub hangover_ms : usize ,
253257}
254258
255259impl SileroVadconfig {
@@ -262,15 +266,15 @@ impl SileroVadconfig {
262266 }
263267
264268 pub fn default_min_speech_duration_ms ( ) -> usize {
265- 150
269+ 400
266270 }
267271
268272 pub fn default_max_silence_duration_ms ( ) -> usize {
269- 400
273+ 200
270274 }
271275
272- pub fn default_audio_cache_ms ( ) -> usize {
273- 1000
276+ pub fn hangover_ms ( ) -> usize {
277+ 500
274278 }
275279}
276280
@@ -281,7 +285,7 @@ impl Default for SileroVadconfig {
281285 neg_threshold : Self :: default_neg_threshold ( ) ,
282286 min_speech_duration_ms : Self :: default_min_speech_duration_ms ( ) ,
283287 max_silence_duration_ms : Self :: default_max_silence_duration_ms ( ) ,
284- audio_cache_ms : Self :: default_audio_cache_ms ( ) ,
288+ hangover_ms : Self :: hangover_ms ( ) ,
285289 }
286290 }
287291}
0 commit comments