0

I am developing an app that records audio from microphone to integer array. Array is then passed to FFT and MFCC. I need to make frames about n samples and I need to 50% overlaps them (they cannot be side by side). So I need 3 buffers - when the first is full is passed to FFT. I this moment app should record second half of second buffer and first half of third buffer. FFT will be separate thread (my idea).

So I tried to sample audio using QAudioRecorder and QAudioProbe. I connected audioBufferProbed signal with processBuffer and there i use buffer.constData<int>(). I seems it works. I understood audioBufferProbed is emitted when buffer is full.

I don't know how to associate more buffers with one recorder. Or start writing to second buffer too at half of first buffer.

Bo Persson
  • 90,663
  • 31
  • 146
  • 203

1 Answers1

0

The easiest way here (since 50% is a nice round number) is to ask Qt for frames half the size of the ones you need for your FFT. You now run your FFT over frames 0&1, 1&2, 2&3, etc.

MSalters
  • 173,980
  • 10
  • 155
  • 350