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. QML Audio is not able to access mp3 file in qrc (windows)

QML Audio is not able to access mp3 file in qrc (windows)

Scheduled Pinned Locked Moved Unsolved General and Desktop
qrcqmlaudiowindows
16 Posts 3 Posters 5.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 Offline
    A Offline
    Albus
    wrote on 3 Nov 2015, 04:18 last edited by Albus 11 Mar 2015, 07:39
    #1

    Hi,

    I am using QML audio to playback mp3 file in qrc. The same code works fine in Mac, iOS and Android. But not in Windows. I am compiling with VC2012 Express in Windows 7.

    If the source file directs to local storage ("file:///../...mp3"), it runs normally. Just not in qrc ("qrc:///.../...mp3")
    Does anyone know how to solve this?

    Thank you.

    Albus
    (P.S. my post is lost, thus I post the question again. If this question is duplicated, please kindly remove the topic. Thank you.)

    1 Reply Last reply
    0
    • S Offline
      S Offline
      SGaist
      Lifetime Qt Champion
      wrote on 3 Nov 2015, 23:36 last edited by
      #2

      Hi,

      That might be a backend limitation, can you check whether you have the DirectX or WMF plugin loaded ?

      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
      • A Offline
        A Offline
        Albus
        wrote on 4 Nov 2015, 08:22 last edited by
        #3

        Thanks for reply.

        I do have wmfengine.dll installed in plugins\mediaservice directory.
        But when I run listDLLs to check my program, there is no WMF or DirectShow related dll loaded, however Qt5Multimedia.dll did have loaded.

        WMF might case the qrc issue? Because it plays normally with files under physical directory.

        Thanks.

        R 1 Reply Last reply 4 Nov 2015, 10:31
        0
        • S Offline
          S Offline
          SGaist
          Lifetime Qt Champion
          wrote on 4 Nov 2015, 09:46 last edited by
          #4

          Do you also have the DirectX plugin ?

          From a quick code check the WMF should handle the qrc case

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

          A 1 Reply Last reply 5 Nov 2015, 03:40
          0
          • A Albus
            4 Nov 2015, 08:22

            Thanks for reply.

            I do have wmfengine.dll installed in plugins\mediaservice directory.
            But when I run listDLLs to check my program, there is no WMF or DirectShow related dll loaded, however Qt5Multimedia.dll did have loaded.

            WMF might case the qrc issue? Because it plays normally with files under physical directory.

            Thanks.

            R Offline
            R Offline
            raf924
            wrote on 4 Nov 2015, 10:31 last edited by
            #5

            @Albus It might be a path error. Check if the file is indeed in your qrc file and check that you're using the right prefix.

            A 1 Reply Last reply 5 Nov 2015, 03:20
            0
            • R raf924
              4 Nov 2015, 10:31

              @Albus It might be a path error. Check if the file is indeed in your qrc file and check that you're using the right prefix.

              A Offline
              A Offline
              Albus
              wrote on 5 Nov 2015, 03:20 last edited by Albus 11 May 2015, 03:21
              #6

              @raf924 Thanks for your advice. I am sure the path is correct, since it works normally in other 3 platforms.

              1 Reply Last reply
              0
              • S SGaist
                4 Nov 2015, 09:46

                Do you also have the DirectX plugin ?

                From a quick code check the WMF should handle the qrc case

                A Offline
                A Offline
                Albus
                wrote on 5 Nov 2015, 03:40 last edited by
                #7

                @SGaist Do you mean "dsengine.dll"? I do have this DirectShow plugin installed.
                And this dll is not loaded while running my program.

                1 Reply Last reply
                0
                • S Offline
                  S Offline
                  SGaist
                  Lifetime Qt Champion
                  wrote on 5 Nov 2015, 21:10 last edited by
                  #8

                  Then try to move it of the multimedia plugin folder to ensure that the WMF plugin gets loaded

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

                  A 1 Reply Last reply 10 Nov 2015, 06:47
                  0
                  • S SGaist
                    5 Nov 2015, 21:10

                    Then try to move it of the multimedia plugin folder to ensure that the WMF plugin gets loaded

                    A Offline
                    A Offline
                    Albus
                    wrote on 10 Nov 2015, 06:47 last edited by
                    #9

                    @SGaist I renamed these dll, nothing special happened, the program ran normally (but when playing the mp3 file, the error was : MediaPlayer fail to load source).

                    Actually, early before when I first tried to run my program, it failed to load every dll it needed, thus I had to copy all dll to have a fast try. But WMF and DS dlls are never asked.

                    1 Reply Last reply
                    0
                    • S Offline
                      S Offline
                      SGaist
                      Lifetime Qt Champion
                      wrote on 10 Nov 2015, 21:50 last edited by
                      #10

                      Starting your application with QT_DEBUG_PLUGINS set to 1 will show you what gets loaded

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

                      A 1 Reply Last reply 11 Nov 2015, 11:35
                      1
                      • S SGaist
                        10 Nov 2015, 21:50

                        Starting your application with QT_DEBUG_PLUGINS set to 1 will show you what gets loaded

                        A Offline
                        A Offline
                        Albus
                        wrote on 11 Nov 2015, 11:35 last edited by
                        #11

                        @SGaist Thanks for the hint. I searched the entire output, not wmf, not dsengine is found.

                        1 Reply Last reply
                        0
                        • S Offline
                          S Offline
                          SGaist
                          Lifetime Qt Champion
                          wrote on 11 Nov 2015, 23:17 last edited by
                          #12

                          Which are loaded ?

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

                          A 1 Reply Last reply 12 Nov 2015, 02:09
                          0
                          • S SGaist
                            11 Nov 2015, 23:17

                            Which are loaded ?

                            A Offline
                            A Offline
                            Albus
                            wrote on 12 Nov 2015, 02:09 last edited by
                            #13

                            @SGaist here is the list:
                            "C:/Qt/Qt5.5.1/5.5/msvc2012/plugins/platforms/qminimal.dll"
                            "C:/Qt/Qt5.5.1/5.5/msvc2012/plugins/platforms/qoffscreend.dll"
                            "C:/Qt/Qt5.5.1/5.5/msvc2012/plugins/platforms/qwindows.dll"
                            loaded library "C:/Qt/Qt5.5.1/5.5/msvc2012/qml/QtQuick.2/qtquick2plugind.dll"
                            C:/Qt/Qt5.5.1/5.5/msvc2012/qml/QtQuick/Controls/qtquickcontrolsplugind.dll, metadata=
                            "C:/Qt/Qt5.5.1/5.5/msvc2012/qml/QtQuick/Controls/qtquickcontrolsplugind.dll"
                            C:/Qt/Qt5.5.1/5.5/msvc2012/qml/QtQuick/Window.2/windowplugind.dll, metadata=
                            loaded library "C:/Qt/Qt5.5.1/5.5/msvc2012/qml/QtQuick/Window.2/windowplugind.dll"
                            C:/Qt/Qt5.5.1/5.5/msvc2012/qml/QtQuick/Layouts/qquicklayoutsplugind.dll, metadata=
                            "C:/Qt/Qt5.5.1/5.5/msvc2012/qml/QtQuick/Layouts/qquicklayoutsplugind.dll"
                            C:/Qt/Qt5.5.1/5.5/msvc2012/qml/Qt/labs/folderlistmodel/qmlfolderlistmodelplugind.dll, "C:/Qt/Qt5.5.1/5.5/msvc2012/qml/Qt/labs/folderlistmodel/qmlfolderlistmodelplugind.dll"
                            "C:/Qt/Qt5.5.1/5.5/msvc2012/plugins/bearer/qgenericbearer.dll"
                            "C:/Qt/Qt5.5.1/5.5/msvc2012/plugins/bearer/qgenericbearerd.dll"
                            "C:/Qt/Qt5.5.1/5.5/msvc2012/plugins/bearer/qnativewifibearer.dll"
                            "C:/Qt/Qt5.5.1/5.5/msvc2012/plugins/bearer/qnativewifibearerd.dll"
                            loaded library "C:/Qt/Qt5.5.1/5.5/msvc2012/plugins/bearer/qgenericbearerd.dll"
                            loaded library "C:/Qt/Qt5.5.1/5.5/msvc2012/plugins/bearer/qnativewifibearerd.dll"
                            loaded library "wlanapi"
                            "C:/Qt/Qt5.5.1/5.5/msvc2012/plugins/audio/qtaudio_windows.dll"
                            "C:/Qt/Qt5.5.1/5.5/msvc2012/plugins/imageformats/qdds.dll"
                            "C:/Qt/Qt5.5.1/5.5/msvc2012/plugins/imageformats/qgif.dll"
                            "C:/Qt/Qt5.5.1/5.5/msvc2012/plugins/imageformats/qicns.dll"
                            "C:/Qt/Qt5.5.1/5.5/msvc2012/plugins/imageformats/qico.dll"
                            "C:/Qt/Qt5.5.1/5.5/msvc2012/plugins/imageformats/qjp2.dll"
                            "C:/Qt/Qt5.5.1/5.5/msvc2012/plugins/imageformats/qjpeg.dll"
                            "C:/Qt/Qt5.5.1/5.5/msvc2012/plugins/imageformats/qmng.dll"
                            "C:/Qt/Qt5.5.1/5.5/msvc2012/plugins/imageformats/qsvg.dll"
                            "C:/Qt/Qt5.5.1/5.5/msvc2012/plugins/imageformats/qtga.dll"
                            "C:/Qt/Qt5.5.1/5.5/msvc2012/plugins/imageformats/qtiff.dll"
                            "C:/Qt/Qt5.5.1/5.5/msvc2012/plugins/imageformats/qwbmpd.pdb"
                            "C:/Qt/Qt5.5.1/5.5/msvc2012/plugins/imageformats/qwebp.dll"
                            "C:/Qt/Qt5.5.1/5.5/msvc2012/plugins/sqldrivers/qsqlite.dll"
                            "C:/Qt/Qt5.5.1/5.5/msvc2012/plugins/sqldrivers/qsqlited.dll"
                            "C:/Qt/Qt5.5.1/5.5/msvc2012/plugins/sqldrivers/qsqlmysql.dll"
                            "C:/Qt/Qt5.5.1/5.5/msvc2012/plugins/sqldrivers/qsqlodbc.dll"
                            "C:/Qt/Qt5.5.1/5.5/msvc2012/plugins/sqldrivers/qsqlpsql.dll"

                            1 Reply Last reply
                            0
                            • S Offline
                              S Offline
                              SGaist
                              Lifetime Qt Champion
                              wrote on 12 Nov 2015, 21:36 last edited by
                              #14

                              What code are you using to play that audio file ?

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

                              A 1 Reply Last reply 13 Nov 2015, 02:20
                              0
                              • S SGaist
                                12 Nov 2015, 21:36

                                What code are you using to play that audio file ?

                                A Offline
                                A Offline
                                Albus
                                wrote on 13 Nov 2015, 02:20 last edited by
                                #15

                                @SGaist here is my code :

                                MediaPlayer {
                                    id: music
                                    autoPlay: true
                                    source: "qrc:///musics/musics/Highway_Wildflowers.mp3"
                                    loops: Audio.Infinite
                                    volume: 0.6 * CallBacks.getFastAudioSettings()[1]
                                }
                                
                                1 Reply Last reply
                                0
                                • S Offline
                                  S Offline
                                  SGaist
                                  Lifetime Qt Champion
                                  wrote on 19 Nov 2015, 23:19 last edited by
                                  #16

                                  Then it probably is using the audio plugin which I'm not sure at all is supporting qrc

                                  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

                                  9/16

                                  10 Nov 2015, 06:47

                                  • Login

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