Volume changing, even though it shouldn't, while changing microphone
-
Hi,
Which version of Qt are you using ?
On which OS does it happen ? -
Qt version: 6.2.2
OS: Windows. I don't know if we've replicated the problem on Linux, we're mainly using the program on Windows.That said, when I change my microphone on Windows normally, meaning outside our Qt application, I have never had such volume problems.
-
Actually, let me correct the problem description in the sense that the volume does not turn very loud, but rather starts clipping heavily (which makes me suspect it exceeded the maximum allowed value).
My teammate who also has had the problem says he may have solved the issue by explicitly setting the QAudioSource volume level each time a new object is instantiated.
-
Did you check the volume value before destroying the source and after creating the new one ?
-
Glad you found out and thanks for sharing !
Can you explain happened with your buffer ?
-
As far as I understand from my teammate's explanation, we have created our own buffer class, and the class sometimes took the last byte of the previous audio sample (we use the 16-bit PCM format) and combined it with the next audio sample's first byte. He fixed the issue by regularly emptying the buffer.
Our buffer class is a subclass of QIODevice.
-
That's surprising to have a residual byte from a 16bit format. Anyway, glad you found the culprit.