Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-77449

QAudioInput periodSize isn't multiple of frame size

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Moved
    • Icon: P4: Low P4: Low
    • None
    • 5.13.0
    • Multimedia
    • Windows

      When you open a QAudioInput, it establishes a period size of 1/5 the buffer size. Unless you explicitly give it a buffer size that is a multiple of five frames, you wind up with a period size that isn't a multiple of the frame size. This means that readAll() on the underlying QIODevice returns partial samples that the application has to reassemble. No sane audio driver works like this.

      In qtmultimedia/src/plugins/windowsaudio/qwindowsaudioinput.cpp, the open() function computes the period size near the beginning. It should truncate it to a multiple of the frame size, and then recompute the buffer size to be five times that. The buffer size is already documented as possibly being adjusted by the QAudioInput start() function.

      There may be analogous issues in Mac or Linux, or perhaps in QAudioOutput.

       

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            timblechmann tim blechmann
            pderocco Paul DeRocco
            Veli-Pekka Heinonen Veli-Pekka Heinonen
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes