Merge pull request #2465 from signalwire/vad
[Core] VAD: Add a math sanity check to the switch_vad_process
This commit is contained in:
commit
ee62332ced
|
@ -206,7 +206,9 @@ SWITCH_DECLARE(switch_vad_state_t) switch_vad_process(switch_vad_t *vad, int16_t
|
|||
j += vad->channels;
|
||||
}
|
||||
|
||||
if (samples && vad->divisor && samples >= vad->divisor) {
|
||||
score = (uint32_t)(energy / (samples / vad->divisor));
|
||||
}
|
||||
#ifdef SWITCH_HAVE_FVAD
|
||||
}
|
||||
#endif
|
||||
|
|
Loading…
Reference in New Issue