|
From: Lasse Kärkkäi. <tr...@us...> - 2011-01-18 13:01:26
|
Module: editor
Branch: master
Commit: 10799b6fdb4de826adac5fb6ba96318099f0df07
Author: Lasse Karkkainen <tro...@tr...>
Date: Tue Jan 18 13:59:45 2011 +0100
Modify Analyzer::input so that it accepts int16 samples too.
---
pitch.hh | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/pitch.hh b/pitch.hh
index cff8cf3..642d8c6 100644
--- a/pitch.hh
+++ b/pitch.hh
@@ -60,6 +60,7 @@ public:
bool overflow = false;
while (begin != end) {
float s = *begin++; // Read input sample
+ if (sizeof(*begin) == 2) s /= 32767.0; // Integer samples (normalize)
// Peak level calculation
float p = s * s;
if (p > m_level) m_level = p; else m_level *= 0.9995;
|