Augmenting each detected voice activity to give recognizer some silence samples to work with

This commit is contained in:
Daniel Wolf 2016-06-27 20:00:37 +02:00
parent 2a5ed95698
commit 75407dab54
1 changed files with 6 additions and 0 deletions

View File

@ -80,6 +80,12 @@ BoundedTimeline<void> detectVoiceActivity(std::unique_ptr<AudioStream> audioStre
} }
} }
// Pad each activity to give the recognizer some breathing room
const centiseconds padding(3);
for (const auto& element : BoundedTimeline<void>(activity)) {
activity.set(element.getStart() - padding, element.getEnd() + padding);
}
logging::debugFormat("Found {} sections of voice activity: {}", activity.size(), logging::debugFormat("Found {} sections of voice activity: {}", activity.size(),
join(activity | transformed([](const Timed<void>& t) { return format("{0}-{1}", t.getStart(), t.getEnd()); }), ", ")); join(activity | transformed([](const Timed<void>& t) { return format("{0}-{1}", t.getStart(), t.getEnd()); }), ", "));