Unsolved Audio FFT Using QIODevice
-
Hey guys. I'm trying to use a QIODevice and a QAudioInput to read audio data into a QByteArray and use that buffer to get FFT amplitude values for different frequencies.
I have connected my input device's notify() signal to a readData() function in my FFT class (this is a normal QObject, doesn't inherit any other class):
connect(inputDevice,SIGNAL(notify()),this,SLOT(readData()));
For the FFT, I would like to have a standard setting:
Window size: 1024
Bins: 512
Sample Period: ~23 mS
Frequency Resolution: ~43 HzSo to make this work, I set my notify interval to 23 mS which would mean that I will have a buffer size of 512 as per the FFT parameters above:
inputDevice -> setNotifyInterval(samplePeriod);
My readData() function runs 3 or 4 times and then it seems like the program just stops without any errors. The issue seems to be that the buffer size of the QIODevice is set to 3528 (same as inputDevice -> periodSize() ) and I can't see a way to change that, it seems to be the nature of the hardware.
Am I missing something here on how to change the buffer size or am I stuck with 3528 bytes?
Thanks a bunch
Roham