Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. Audio FFT Using QIODevice

Audio FFT Using QIODevice

Scheduled Pinned Locked Moved Unsolved Qt Creator and other tools
1 Posts 1 Posters 373 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    rtavakko
    wrote on last edited by
    #1

    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 Hz

    So 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

    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved