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

[Reg 6.2 -> 6.5] Repeated QSoundEffect is broken on PulseAudio

    XMLWordPrintable

Details

    • Linux/X11
    • 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

      1. Build and run the attached example
      2. Click the button to start the sound effect
      3. 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

        1. QSoundEffectBug.zip
          240 kB
          Sze Howe Koh

        Issue Links

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

          Activity

            People

              mikko.hallamaa Mikko Hallamaa
              skoh-qt Sze Howe Koh
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes