Details
-
Bug
-
Resolution: Unresolved
-
P4: Low
-
None
-
5.13.0
Description
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.