Qt World Summit: Submit your Presentation

QAuidoInput buffer size problem

  • Hey my friends, I have a problem with QAudioInput class on Desktop platforms:
    If I would like to get a specific number of samples from microphone, for example N samples:
    On Windows : I should set the BufferSize of QAudioInput Object to N*5 to get the N samples on writeData function of attached QIODevice object to the QAudioInput Object
    On OSX : I should set the same N as the buffer size
    Is there anyone who had the same experience?
    Do you know why the buffer size has not reliable behavior?

    Qt version: 5.9
    Host machine architecture: x64
    OS: windows, mac, Linux [Ubuntu]

  • Lifetime Qt Champion


    See the documentation of bufferSize, you may not get what you requested because setting e.g. a too small buffer size might trigger overflow problem.