Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. SoundEffect change source
Qt 6.11 is out! See what's new in the release blog

SoundEffect change source

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
8 Posts 2 Posters 3.5k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • U Offline
    U Offline
    Uwe Koehler
    wrote on last edited by
    #1

    Hi there,

    when I change the source of a SoundEffect I hear the old and the new sound with the next play(). Is there any way I can avoid that?

    Many thanks for any help in advance

    Uwe

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      Do you mean you only here it once and then it's gone ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      U 1 Reply Last reply
      0
      • SGaistS SGaist

        Hi,

        Do you mean you only here it once and then it's gone ?

        U Offline
        U Offline
        Uwe Koehler
        wrote on last edited by
        #3

        @SGaist Thanks for the reply. Let me clear this up:

        SoundEffect {
                id: trialgong
                source: tone
                onSourceChanged: {
                    play()
                }
            }
        

        When I now set a new source to trialgong with
        trialgong.source = something
        I can here the old and the new sound. I would expect to just here the new sound. I am using Qt 5.5 on Linux.

        I had the same behavior when issuing

        trialgong.source = something
        trialgong.play()
        

        instead of using onSourceChanged.

        Any ideas?

        Uwe

        1 Reply Last reply
        0
        • U Offline
          U Offline
          Uwe Koehler
          wrote on last edited by
          #4

          Hmm, got the same problem when using QSoundEffect in C++. I am preparing a small sample project for a bug report. Have to learn how to record the output in Linux to attach.

          Tried on Android and cannot reproduce the problem there.

          1 Reply Last reply
          0
          • SGaistS Offline
            SGaistS Offline
            SGaist
            Lifetime Qt Champion
            wrote on last edited by
            #5

            If it makes things simpler, use an external device like your phone to record the output

            Interested in AI ? www.idiap.ch
            Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

            1 Reply Last reply
            0
            • U Offline
              U Offline
              Uwe Koehler
              wrote on last edited by
              #6

              Many thanks for your encouragement.

              I filed bug report QTBUG-48982 including a recorded sample output and an example project.

              1 Reply Last reply
              0
              • SGaistS Offline
                SGaistS Offline
                SGaist
                Lifetime Qt Champion
                wrote on last edited by
                #7

                Thanks !

                Since 5.5.1 is out, can you test with that version to see if it behaves better ?

                Interested in AI ? www.idiap.ch
                Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                1 Reply Last reply
                0
                • U Offline
                  U Offline
                  Uwe Koehler
                  wrote on last edited by
                  #8

                  Still happens with Qt 5.5.1 Linux. Added Comment to the bug report to that respect.

                  1 Reply Last reply
                  0

                  • Login

                  • Login or register to search.
                  • First post
                    Last post
                  0
                  • Categories
                  • Recent
                  • Tags
                  • Popular
                  • Users
                  • Groups
                  • Search
                  • Get Qt Extensions
                  • Unsolved