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. Set volume globally
Forum Updated to NodeBB v4.3 + New Features

Set volume globally

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
2 Posts 2 Posters 650 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.
  • M Offline
    M Offline
    MartinD
    wrote on last edited by
    #1

    Hi,
    is it possible to globally set volume of audio output of my application?

    I have several QSoundEffect sounds in my QML application. I thought about the possibility to set some global context variable (double with 0.0 to 1.0 value) to QML and then use it in my sounds:

    SoundEffect {
            volume: 0.25 * myGlobalVolume
        }
    

    However, is there a better way to achieve this?

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

      Hi,

      Do you mean something like a VolumeController object that has a volume property ? You could set it using setContextProperty, then it would be available to your effects.

      Hope it helps.

      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

      • Login

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