Details
-
Bug
-
Resolution: Fixed
-
P1: Critical
-
6.2.10, 6.5.2
-
-
853d36bd8 (dev), 20ecf1a9b (6.7), 5bd1a0b07 (6.6), b34a08dc3 (tqtc/lts-6.5), 57bf3f663 (dev), 03b3d033b (6.7), cf285e86f (6.6), 65426b8e5 (tqtc/lts-6.5)
-
G&UI Finishing 2023, Multimedia Wk7
Description
Code
#include <QApplication> #include <QPushButton> #include <QSoundEffect> int main(int argc, char *argv[]) { QApplication app(argc, argv); QSoundEffect effect; effect.setSource(QUrl("qrc:/boom.wav")); QPushButton button("Explode"); button.show(); QObject::connect(&button, &QPushButton::clicked, &app, [&]{ effect.play(); }); return app.exec(); }
Steps to reproduce
- Build and run the attached example
- Click the button to start the sound effect
- Click the button again while the first effect is still playing
Expected outcomes
The 2nd click plays the whole effect normally.
Actual outcomes
The 2nd click produces a short audible glitch followed by silence.
Workaround
Instead of keeping the QSoundEffect around and playing it repeatedly, create a new QSoundEffect for each play and delete it after.
Attachments
Issue Links
- is duplicated by
-
QTBUG-123784 SoundEffect audio issue
- Closed
- relates to
-
QTBUG-121941 The audio stops playing or is breaking up when switching between the modes several times in audio output example
- Closed