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. QSoundEffect problem :/
QtWS25 Last Chance

QSoundEffect problem :/

Scheduled Pinned Locked Moved Solved General and Desktop
qsoundeffectqsound
5 Posts 3 Posters 4.2k 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.
  • W Offline
    W Offline
    Walux
    wrote on last edited by Walux
    #1

    Hi Qt Community ,

    So in my program , i have 1 QSound and 1 QSoundEffect that is configured in a certain volume .My QSoundEffect is brief , but the other QSound is used for background theme , the problem is when the brief sound is activated , it imposes its volume level on myother background sound , causing it to be almost muted.

    Any ideas :) ?
    I'll be grateful for your help.

    Taking things from beginning to end : That's my entertainment !

    Joel BodenmannJ 1 Reply Last reply
    0
    • W Walux

      Hi Qt Community ,

      So in my program , i have 1 QSound and 1 QSoundEffect that is configured in a certain volume .My QSoundEffect is brief , but the other QSound is used for background theme , the problem is when the brief sound is activated , it imposes its volume level on myother background sound , causing it to be almost muted.

      Any ideas :) ?
      I'll be grateful for your help.

      Joel BodenmannJ Offline
      Joel BodenmannJ Offline
      Joel Bodenmann
      wrote on last edited by
      #2

      I'm gonna lean out of the window a bit here.... Why not using QSoundEffect::setVolume() to lower the volume of the sound effect?
      Maybe I'm misunderstanding the problem... feel free to yell at me.

      Industrial process automation software: https://simulton.com
      Embedded Graphics & GUI library: https://ugfx.io

      W 1 Reply Last reply
      0
      • Joel BodenmannJ Joel Bodenmann

        I'm gonna lean out of the window a bit here.... Why not using QSoundEffect::setVolume() to lower the volume of the sound effect?
        Maybe I'm misunderstanding the problem... feel free to yell at me.

        W Offline
        W Offline
        Walux
        wrote on last edited by
        #3

        @Joel-Bodenmann

        Hhhh , don't feel like yelling right now :b
        But yeah , i don't think you understood clearly.

        The problem in other terms is visible in these small lines of code :

            backgroundTheme = new QSound("://sounds/Background.wav",this);
            backgroundTheme->setLoops(QSound::Infinite);
            backgroundTheme->play();
        
            correctAnswer.setSource(QUrl::fromLocalFile("://sounds/Correct Answer.wav"));
            correctAnswer.setVolume(0.05);
        

        As you can see , the QSoundEffect is set to low volume (because it's very loud) , while the QSound is in full volume , the problem is when i run the program , the background music is working just fine , but when the QSoundEffect plays , the background music's volume gets low (i think its volume got set to my QSoundEffect's volume)

        Any ideas how to fix that :) ?
        I'm afraid the answer can be really obvious ^^'

        Taking things from beginning to end : That's my entertainment !

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

          Hi,

          Take a look at this thread. Unless I'm mistaken it's still relevant for what you are experiencing.

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

          W 1 Reply Last reply
          2
          • SGaistS SGaist

            Hi,

            Take a look at this thread. Unless I'm mistaken it's still relevant for what you are experiencing.

            W Offline
            W Offline
            Walux
            wrote on last edited by
            #5

            @SGaist

            Huge thanks for the shared link :)

            Topic->setAsClosed(true);

            Taking things from beginning to end : That's my entertainment !

            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