summaryrefslogtreecommitdiffstats
path: root/src/analyserqueue.cpp
diff options
context:
space:
mode:
authorUwe Klotz <uwe_klotz@web.de>2014-11-10 17:30:09 +0100
committerUwe Klotz <uwe_klotz@web.de>2014-11-15 19:42:50 +0100
commitfd9f31545f9136164c26da7aae60944f1f93ed29 (patch)
tree257f642f75cf622baa55f17cd4cf69209de40d74 /src/analyserqueue.cpp
parent34de62d51e9137a379769396a22adf39764bc385 (diff)
Enhance and reuse SampleUtil
Diffstat (limited to 'src/analyserqueue.cpp')
-rw-r--r--src/analyserqueue.cpp7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/analyserqueue.cpp b/src/analyserqueue.cpp
index 4cf7b55df9..699d6f3f18 100644
--- a/src/analyserqueue.cpp
+++ b/src/analyserqueue.cpp
@@ -8,6 +8,7 @@
#include "analyserqueue.h"
#include "soundsourceproxy.h"
#include "playerinfo.h"
+#include "sampleutil.h"
#include "util/timer.h"
#include "library/trackcollection.h"
#include "analyserwaveform.h"
@@ -197,11 +198,7 @@ bool AnalyserQueue::doAnalysis(TrackPointer tio, SoundSourceProxy* pSoundSource)
dieflag = true;
}
- // Normalize the samples from [SHRT_MIN, SHRT_MAX] to [-1.0, 1.0].
- // TODO(rryan): Change the SoundSource API to do this for us.
- for (int i = 0; i < read; ++i) {
- m_pSamples[i] = static_cast<CSAMPLE>(m_pSamplesPCM[i]) / SHRT_MAX;
- }
+ SampleUtil::convertS16ToFloat32(m_pSamples, m_pSamplesPCM, read);
QListIterator<Analyser*> it(m_aq);