23#include <QAudioFormat>
25#include <QAudioDeviceInfo>
26#include <QElapsedTimer>
32qreal pcmToReal(qint16 pcm);
42 explicit SWFFTCalc( QObject* parent =
nullptr );
49 void spectrumReady(
const SWDoubleVec& spectrum );
53 typedef std::complex<double> Complex;
54 typedef std::valarray<Complex> CArray;
59 void bareFFT( CArray& x );
61 static constexpr const int SWNUMSAMPLES = 4096;
62 const double PI = 3.141592653589793238460;
66 const qreal SpectrumAnalyserMultiplier = 0.10;
68 QAudioBuffer::S32F _s32f;
69 QAudioBuffer::S16S _s16s;
70 QAudioBuffer::S16U _s16u;
71 QAudioBuffer::S8S _s8s;
72 QAudioBuffer::S8U _s8u;
82 int _bufferDuration = 0;
85 SWDoubleVec _hannWindow;
88 SWDoubleVec _spectrum;
void collectFrames(QAudioBuffer &audiobuffer)
Track::getPeakValue.