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. Play a sound

Play a sound

Scheduled Pinned Locked Moved Solved General and Desktop
8 Posts 3 Posters 3.4k 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.
  • C Offline
    C Offline
    cmdEvo
    wrote on last edited by
    #1

    Hello everyone,

    I'm trying to play a short sound with QSound. Everything works under GNU/Linux but no sound comes out of my speakers under Windows.
    Here is my code (very simple) :

    QSound::play(":/ressources/audio/notification.wav")
    

    and the error message displayed in the terminal :

    using null output device, none available
    

    Does somebody knows what happens ? Is there a package to install with the maintenanceTool ?

    Thank you so much !

    JonBJ 1 Reply Last reply
    0
    • C cmdEvo

      Hello everyone,

      I'm trying to play a short sound with QSound. Everything works under GNU/Linux but no sound comes out of my speakers under Windows.
      Here is my code (very simple) :

      QSound::play(":/ressources/audio/notification.wav")
      

      and the error message displayed in the terminal :

      using null output device, none available
      

      Does somebody knows what happens ? Is there a package to install with the maintenanceTool ?

      Thank you so much !

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

      @cmdEvo said in Play a sound:
      Google for qt using null output device, none available
      E.g. https://forum.qt.io/topic/31004/error-using-null-output-device-none-available
      I admit they seem to be more Linux than Windows, but might be a starting point for ideas?

      1 Reply Last reply
      0
      • C Offline
        C Offline
        cmdEvo
        wrote on last edited by
        #3

        Yes, I've already seen this topic but I didn't manage to find an answer to my issue, do you have any suggestions ?

        1 Reply Last reply
        0
        • B Offline
          B Offline
          Bonnie
          wrote on last edited by Bonnie
          #4

          Looks like your qpa audio plugin is not loaded.

          Qt comes with plugins for Windows (WinMM and WASAPI), Linux (ALSA and PulseAudio), macOS / iOS (CoreAudio), Android (OpenSL ES) and QNX.
          If no audio plugins are available, a fallback dummy backend will be used. This should print out warnings if this is the case when you try and use QAudioInput or QAudioOutput. To fix this problem, make sure the dependencies for the Qt plugins are installed on the system and reconfigure Qt (e.g. alsa-devel package on Linux), or create your own plugin with a default key to always override the dummy fallback. The easiest way to determine if you have only a dummy backend is to get a list of available audio devices.
          QAudioDeviceInfo::availableDevices(QAudio::AudioOutput).size() = 0 (dummy backend)

          Maybe you can set QT_DEBUG_PLUGINS environment variable to 1 to check the reason.
          I remember someone once said about need to install some media package in Windows.

          1 Reply Last reply
          2
          • C Offline
            C Offline
            cmdEvo
            wrote on last edited by
            #5

            ideed, I have no available devices, but I don't know why !!

            1 Reply Last reply
            0
            • C Offline
              C Offline
              cmdEvo
              wrote on last edited by cmdEvo
              #6

              I have found out a solution.
              I have just copied the folder named 'plugins' from Qt\5.15.0\mingw81_64 to the release folder and it works.
              Could somebody explain me why please ? Is there an other way to load the needed plugin ?

              Source : https://forum.qt.io/topic/48800/solved-qaudiodeviceinfo-availabledevices-no-device-found-if-start-on-pc-without-qt-installed/5

              B 1 Reply Last reply
              0
              • C cmdEvo

                I have found out a solution.
                I have just copied the folder named 'plugins' from Qt\5.15.0\mingw81_64 to the release folder and it works.
                Could somebody explain me why please ? Is there an other way to load the needed plugin ?

                Source : https://forum.qt.io/topic/48800/solved-qaudiodeviceinfo-availabledevices-no-device-found-if-start-on-pc-without-qt-installed/5

                B Offline
                B Offline
                Bonnie
                wrote on last edited by
                #7

                @cmdEvo
                Oh, you didn't have the plugin folders with your application?
                Then the plugin of course won't be loaded.
                You need to copy them. That's how it works.
                But you only need plugins\audio\qtaudio_windows.dll for the audio thing.

                1 Reply Last reply
                1
                • C Offline
                  C Offline
                  cmdEvo
                  wrote on last edited by
                  #8

                  Oh ok thank you for your help !!

                  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