[PATCH] TOOLS: fix average energy output for completely silent samples



Output average energy = -200 instead of -inf, in order to be able to parse
and compare features using bsefextract.

Signed-off-by: Stefan Westerfeld <stefan space twc de>
---
 tools/bsefextract.cc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/bsefextract.cc b/tools/bsefextract.cc
index 501698b..2b4f90a 100644
--- a/tools/bsefextract.cc
+++ b/tools/bsefextract.cc
@@ -515,7 +515,7 @@ struct AvgEnergyFeature : public Feature
     if (avg_energy_count)
       avg_energy /= avg_energy_count;
 
-    avg_energy = 10 * log (avg_energy) / log (10);
+    avg_energy = bse_db_from_factor (sqrt (avg_energy), -200);
   }
 
   void print_results() const
-- 
2.7.4



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]