Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Unsolved QAuidoInput buffer size problem

    General and Desktop
    qaudioinput buffer qt5.9
    2
    2
    864
    Loading More Posts
    • 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
      returnx last edited by

      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]

      1 Reply Last reply Reply Quote 0
      • SGaist
        SGaist Lifetime Qt Champion last edited by

        Hi,

        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.

        Interested in AI ? www.idiap.ch
        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

        1 Reply Last reply Reply Quote 1
        • First post
          Last post