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. Can't play sound.
Forum Updated to NodeBB v4.3 + New Features

Can't play sound.

Scheduled Pinned Locked Moved Unsolved General and Desktop
12 Posts 4 Posters 1.1k 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 architect23

    Hello, I have problem with playing sound.I have code:

    QMediaPlayer *player = new QMediaPlayer(this, QMediaPlayer::StreamPlayback);
        QUrl file = QUrl::fromLocalFile("C:/Users/Downloads/Telegram Desktop/123.mp3");
        player->setMedia(file);
        player->setVolume(99);
        player->play();
    

    But sound don't work. I make new compile: plugins.pro(new Qt5Multimediad.dll, new wmfengined.dll, new dsengined.dll) but I have message in my app:
    Cannot load library C:\qt2\5.15.2\msvc2019_64\plugins\mediaservice\dsengined.dll: The specified module could not be found.
    QLibraryPrivate::loadPlugin failed on "C:/qt2/5.15.2/msvc2019_64/plugins/mediaservice/dsengined.dll" : "Cannot load library C:\qt2\5.15.2\msvc2019_64\plugins\mediaservice\dsengined.dll: The specified module could not be found."
    Cannot load library C:\qt2\5.15.2\msvc2019_64\plugins\mediaservice\wmfengined.dll: The specified module could not be found.
    QLibraryPrivate::loadPlugin failed on "C:/qt2/5.15.2/msvc2019_64/plugins/mediaservice/wmfengined.dll" : "Cannot load library C:\qt2\5.15.2\msvc2019_64\plugins\mediaservice\wmfengined.dll: The specified module could not be found."
    QMediaPluginLoader: loaded plugins for key "org.qt-project.qt.mediaplayer" : ("directshow")
    defaultServiceProvider::requestService(): no service found for - "org.qt-project.qt.mediaplayer"
    What is wrong?

    jsulmJ Offline
    jsulmJ Offline
    jsulm
    Lifetime Qt Champion
    wrote on last edited by
    #2

    @architect23 said in Can't play sound.:

    What is wrong?

    Did you check whether those DLLs are there or not?
    How did you install Qt?

    "I make new compile: plugins.pro(new Qt5Multimediad.dll, new wmfengined.dll, new dsengined.dll)" - what does "new" mean here? What did you change?

    You should also add error handling to your app (https://doc.qt.io/qt-5/qmediaplayer.html#error-1).

    https://forum.qt.io/topic/113070/qt-code-of-conduct

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

      1)Of course I checked exist dll in "C:\qt2\5.15.2\msvc2019_64\plugins\mediaservice"
      2)I downloaded offline installer 5.15.2
      3)I built new dll and reversed they in path "C:\qt2\5.15.2\msvc2019_64\plugins\mediaservice"

      jsulmJ 1 Reply Last reply
      0
      • jsulmJ jsulm

        @architect23 said in Can't play sound.:

        What is wrong?

        Did you check whether those DLLs are there or not?
        How did you install Qt?

        "I make new compile: plugins.pro(new Qt5Multimediad.dll, new wmfengined.dll, new dsengined.dll)" - what does "new" mean here? What did you change?

        You should also add error handling to your app (https://doc.qt.io/qt-5/qmediaplayer.html#error-1).

        A Offline
        A Offline
        architect23
        wrote on last edited by
        #4

        @jsulm I have :
        QMediaPlayer::ServiceMissingError 5 A valid playback service was not found, playback cannot proceed.

        1 Reply Last reply
        0
        • A architect23

          1)Of course I checked exist dll in "C:\qt2\5.15.2\msvc2019_64\plugins\mediaservice"
          2)I downloaded offline installer 5.15.2
          3)I built new dll and reversed they in path "C:\qt2\5.15.2\msvc2019_64\plugins\mediaservice"

          jsulmJ Offline
          jsulmJ Offline
          jsulm
          Lifetime Qt Champion
          wrote on last edited by
          #5

          @architect23 said in Can't play sound.:

          I built new dll

          Why?

          https://forum.qt.io/topic/113070/qt-code-of-conduct

          A 1 Reply Last reply
          0
          • jsulmJ jsulm

            @architect23 said in Can't play sound.:

            I built new dll

            Why?

            A Offline
            A Offline
            architect23
            wrote on last edited by
            #6

            @jsulm because I read it on dif website

            jsulmJ 1 Reply Last reply
            0
            • A architect23

              @jsulm because I read it on dif website

              jsulmJ Offline
              jsulmJ Offline
              jsulm
              Lifetime Qt Champion
              wrote on last edited by
              #7

              @architect23 I still do not understand this: why do you think you need to built new DLLs?

              https://forum.qt.io/topic/113070/qt-code-of-conduct

              A 2 Replies Last reply
              0
              • jsulmJ jsulm

                @architect23 I still do not understand this: why do you think you need to built new DLLs?

                A Offline
                A Offline
                architect23
                wrote on last edited by
                #8

                @jsulm because i saw, that my project did't see dlls

                KroMignonK 1 Reply Last reply
                0
                • jsulmJ jsulm

                  @architect23 I still do not understand this: why do you think you need to built new DLLs?

                  A Offline
                  A Offline
                  architect23
                  wrote on last edited by
                  #9

                  @jsulm Can you tell me what i must do? :)

                  1 Reply Last reply
                  0
                  • A architect23

                    @jsulm because i saw, that my project did't see dlls

                    KroMignonK Offline
                    KroMignonK Offline
                    KroMignon
                    wrote on last edited by
                    #10

                    @architect23 said in Can't play sound.:

                    because i saw, that my project did't see dlls

                    What do you mean with this?
                    To use QMediaPlayer, you have to enable multimedia libraries in your project by adding QT += multimedia in your PRO file.

                    It is an old maxim of mine that when you have excluded the impossible, whatever remains, however improbable, must be the truth. (Sherlock Holmes)

                    A 1 Reply Last reply
                    0
                    • KroMignonK KroMignon

                      @architect23 said in Can't play sound.:

                      because i saw, that my project did't see dlls

                      What do you mean with this?
                      To use QMediaPlayer, you have to enable multimedia libraries in your project by adding QT += multimedia in your PRO file.

                      A Offline
                      A Offline
                      architect23
                      wrote on last edited by
                      #11

                      @KroMignon of course I did it:

                      QT       += core gui multimedia
                      
                      1 Reply Last reply
                      0
                      • B Offline
                        B Offline
                        BronnyYee
                        Banned
                        wrote on last edited by
                        #12
                        This post is deleted!
                        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