diff options
author | Uwe Klotz <uwe_klotz@web.de> | 2014-11-10 17:30:09 +0100 |
---|---|---|
committer | Uwe Klotz <uwe_klotz@web.de> | 2014-11-15 19:42:50 +0100 |
commit | fd9f31545f9136164c26da7aae60944f1f93ed29 (patch) | |
tree | 257f642f75cf622baa55f17cd4cf69209de40d74 /src/analyserqueue.cpp | |
parent | 34de62d51e9137a379769396a22adf39764bc385 (diff) |
Enhance and reuse SampleUtil
Diffstat (limited to 'src/analyserqueue.cpp')
-rw-r--r-- | src/analyserqueue.cpp | 7 |
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); |