Discard very short segments of voice activity
This prevents short flickers from false VAD positives.
This fixes a regression recently introduced in 2bbad258c0
.
This commit is contained in:
parent
21392d32cc
commit
c821788569
|
@ -75,6 +75,14 @@ JoiningBoundedTimeline<void> detectVoiceActivity(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Discard very short segments of activity
|
||||||
|
const centiseconds minSegmentLength(5);
|
||||||
|
for (const auto& segment : activity) {
|
||||||
|
if (segment.getDuration() < minSegmentLength) {
|
||||||
|
activity.clear(segment.getTimeRange());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
logging::debugFormat(
|
logging::debugFormat(
|
||||||
"Found {} sections of voice activity: {}",
|
"Found {} sections of voice activity: {}",
|
||||||
activity.size(),
|
activity.size(),
|
||||||
|
|
Loading…
Reference in New Issue