From cd622f432f65d28008784f8065b34631d4349141 Mon Sep 17 00:00:00 2001 From: Bob van Loosen Date: Wed, 29 Jul 2020 20:13:36 +0200 Subject: [PATCH] fixed: compile --- src/bitvis/bitvis.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/bitvis/bitvis.cpp b/src/bitvis/bitvis.cpp index 69b04b8..407c3c4 100644 --- a/src/bitvis/bitvis.cpp +++ b/src/bitvis/bitvis.cpp @@ -30,6 +30,7 @@ #include #include #include +#include using namespace std; @@ -460,7 +461,11 @@ void CBitVis::ProcessAudio() m_nrffts++; for (int j = 0; j < m_nrbins; j++) - m_fftbuf[j] += cabsf(m_fft.m_outbuf[j]) / m_fft.m_bufsize; + { + std::complex bin; + memcpy(&bin, m_fft.m_outbuf[j], sizeof(bin)); + m_fftbuf[j] += std::abs(bin) / m_fft.m_bufsize; + } } if (m_samplecounter % (samplerate / m_fps) == 0)