-
Bug
-
Resolution: Fixed
-
P2: Important
-
6.4.1
-
None
-
-
cb8cb4923 (dev), 983aea3d9 (6.5)
The following program:
int main (int argc, char **argv) { QCoreApplication a(argc, argv); for (auto in : QMediaDevices::audioInputs()) qDebug() << "in" << in.description(); for (auto out : QMediaDevices::audioOutputs()) qDebug() << "out" << out.description(); // adjust indices for your system QAudioDevice indev = QMediaDevices::audioInputs()[1]; QAudioDevice outdev = QMediaDevices::audioOutputs()[0]; QAudioFormat format = outdev.preferredFormat(); QAudioSource *input = new QAudioSource(indev, format); QAudioSink *output = new QAudioSink(outdev, format); QObject::connect(input, &QAudioSource::stateChanged, [&](auto state){qDebug()<<"input"<<state<<input->error();}); QObject::connect(output, &QAudioSink::stateChanged, [&](auto state){qDebug()<<"output"<<state<<output->error();}); #if 0 // this produces silence QIODevice *iod = input->start(); output->setBufferSize(input->bufferSize()); output->start(iod); #else // this produces buffer repeats QIODevice *iod = output->start(); input->setBufferSize(output->bufferSize()); input->start(iod); #endif // setBufferSize above has no effect. }
Fails to stream the QAudioSource to the QAudioSink in Qt 6.4.1, but the equivalent code succeeds in Qt 5.15.
If the input is opened first, then only silence results. No errors are reported.
If the output is opened first, then buffer section repeats are heard (the audio plays, but it is chopped up out of order), and UnderrunErrors are repeatedly encountered.
With Qt 5.15.2, both strategies succeed.
Could be related to – or even identical to – https://bugreports.qt.io/browse/QTBUG-108672.
For Gerrit Dashboard: QTBUG-108676 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
452098,1 | Move QWindowsAudioSource from old wave device to use new IAudioClient | 6.4 | qt/qtmultimedia | Status: NEW | +2 | 0 |
450273,5 | Move QWindowsAudioSource from old wave device to use new IAudioClient | dev | qt/qtmultimedia | Status: MERGED | +2 | 0 |
452099,2 | Move QWindowsAudioSource from old wave device to use new IAudioClient | 6.5 | qt/qtmultimedia | Status: MERGED | +2 | 0 |