From 334f1b891d6af62896e67783dc3e47630a27fed0 Mon Sep 17 00:00:00 2001 From: Chris Cannam Date: Tue, 15 Sep 2020 13:43:31 +0100 Subject: [PATCH] ... but don't do so ad infinitum, if some processing problem is causing implausibly high output values --- main/main.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/main/main.cpp b/main/main.cpp index 6404fbe..6369a25 100644 --- a/main/main.cpp +++ b/main/main.cpp @@ -725,6 +725,14 @@ int main(int argc, char **argv) << "reduced gain of " << gain << " (supply --ignore-clipping to avoid this)" << endl; } + const float mingain = 0.75f; + if (gain < mingain) { + cerr << "WARNING: Clipped values were implausibly high: " + << "something wrong with input or process - " + << "not reducing gain below " << mingain << endl; + gain = mingain; + ignoreClipping = true; + } successful = false; break; }