Handling zero-length audio files

This commit is contained in:
Daniel Wolf
2016-04-12 18:07:53 +02:00
parent 7bc4e37a1a
commit 90e1375f1b
3 changed files with 13 additions and 6 deletions

View File

@@ -288,6 +288,11 @@ Timeline<Phone> detectPhones(
boost::optional<std::string> dialog,
ProgressSink& progressSink)
{
// Pocketsphinx doesn't like empty input
if (audioStream->getTruncatedRange().getLength() == centiseconds::zero()) {
return Timeline<Phone>{};
}
// Discard Pocketsphinx output
err_set_logfp(nullptr);