Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QEffectSound with Qt6.3
Qt 6.11 is out! See what's new in the release blog

QEffectSound with Qt6.3

Scheduled Pinned Locked Moved Unsolved General and Desktop
5 Posts 3 Posters 410 Views
  • 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.
  • A Offline
    A Offline
    Alfredy
    wrote on last edited by
    #1

    Hello I have a problem with QEffectSound on Qt 6
    My code here :

    QSoundEffect sound;
    sound.setSource(QUrl::fromLocalFile("fi.wav"));
    sound.setLoopCount(1);
    sound.setVolume(75.0f);
    sound.play();
    
    Christian EhrlicherC 1 Reply Last reply
    0
    • A Alfredy

      Hello I have a problem with QEffectSound on Qt 6
      My code here :

      QSoundEffect sound;
      sound.setSource(QUrl::fromLocalFile("fi.wav"));
      sound.setLoopCount(1);
      sound.setVolume(75.0f);
      sound.play();
      
      Christian EhrlicherC Online
      Christian EhrlicherC Online
      Christian Ehrlicher
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @Alfredy said in QEffectSound with Qt6.3:

      Hello I have a problem with QEffectSound on Qt 6

      And now we have to guess what the problem is?

      Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
      Visit the Qt Academy at https://academy.qt.io/catalog

      1 Reply Last reply
      1
      • A Offline
        A Offline
        Alfredy
        wrote on last edited by
        #3

        Sorry I try to play but the sound is not work?

        Christian EhrlicherC JonBJ 2 Replies Last reply
        0
        • A Alfredy

          Sorry I try to play but the sound is not work?

          Christian EhrlicherC Online
          Christian EhrlicherC Online
          Christian Ehrlicher
          Lifetime Qt Champion
          wrote on last edited by
          #4

          Please provide a minimal, compilable example of your problem. Your code above will work fine when fi.wav is in yourcurrent path and QSoundEffect lives long enough. Both can't be proven from anyone else but you.

          Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
          Visit the Qt Academy at https://academy.qt.io/catalog

          1 Reply Last reply
          1
          • A Alfredy

            Sorry I try to play but the sound is not work?

            JonBJ Offline
            JonBJ Offline
            JonB
            wrote on last edited by
            #5

            @Alfredy
            As @Christian-Ehrlicher says. Two obvious possibilities:

            • "File not found" for WAV file.
            • What is the scope of QSoundEffect sound? I believe it has to remain in existence, sound.play() only starts playing the sound, not blocks while it plays?
            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