Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Special Interest Groups
  3. Qt on BlackBerry and QNX
  4. MediaPlayer and sounds not in resource

MediaPlayer and sounds not in resource

Scheduled Pinned Locked Moved Qt on BlackBerry and QNX
10 Posts 2 Posters 6.0k 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
    AlterX
    wrote on last edited by
    #1

    Hello,
    I am trying to play a sound using relative path...to achieve this I am using DEPLOYMENTFOLDERS to copy files onto BB10 and then trying something like this:
    @
    MediaPlayer {
    source: "../sound/audio.wav"
    }
    @

    It doesn't work: it shows me:
    @
    "Failed to copy resource file to temporary file /accounts/1000/appdata/com.example.TestSoundBB.testDev_TestSoundBBce1d120c/tmp/qtmedia_{625ad0cf-9bb1-4c3e-a349-7989dbddaff1}.wav for playback"
    @

    I have to do something extra, maybe set directory in bar-descriptor.xml!?

    Qt Ambassador
    Real-time cooperative teams: http://www.softairrealfight.net
    Free Real-time network platform sdk: https://github.com/AlterX76/Solomon

    https://codereview.qt-project.org/...

    1 Reply Last reply
    0
    • VladimirMinenkoV Offline
      VladimirMinenkoV Offline
      VladimirMinenko
      wrote on last edited by
      #2

      where this DEPLOYMENTFOLDERS does come from? It does not look something BB10 related... That is your QtDir::HomePath()? You have to make sure that all default path set right before using relative paths. Relative paths should also fit with the sandbox security model on BB10

      --
      Vladimir

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

        DEPLOYMENTFOLDERS is a standard Qt way to deploy file to devices using it in pro file.
        I mean it worked with symbian, meego and right now with new Android Qt port.

        Qt Ambassador
        Real-time cooperative teams: http://www.softairrealfight.net
        Free Real-time network platform sdk: https://github.com/AlterX76/Solomon

        https://codereview.qt-project.org/...

        1 Reply Last reply
        0
        • VladimirMinenkoV Offline
          VladimirMinenkoV Offline
          VladimirMinenko
          wrote on last edited by
          #4

          Ah, ok... No, this variable is not evaluated/used for BB10. You currently have to specify all assets in the bar descr file, those in the pro file will be ignored. Due to this, there will be no conflicts, you just need to update two places, if assets change. I will put this topic on the list though. There is an initiative to unify deployment across possibly all targets some time in the future.

          --
          Vladimir

          1 Reply Last reply
          0
          • A Offline
            A Offline
            AlterX
            wrote on last edited by
            #5

            That is importante to know behaviour on BB...so how Van I specify a dir of audios in bar-descriptor and then I can just sue relative path...could you provvide a little example ?

            Qt Ambassador
            Real-time cooperative teams: http://www.softairrealfight.net
            Free Real-time network platform sdk: https://github.com/AlterX76/Solomon

            https://codereview.qt-project.org/...

            1 Reply Last reply
            0
            • VladimirMinenkoV Offline
              VladimirMinenkoV Offline
              VladimirMinenko
              wrote on last edited by
              #6

              Ok, I will add it to the section "Where do the app resources land on the device" in "this":http://qt-project.org/wiki/Deployment_on_BlackBerry article. In the next days. Working on other things right now... :-)

              --
              Vladimir

              1 Reply Last reply
              0
              • A Offline
                A Offline
                AlterX
                wrote on last edited by
                #7

                I have read how BB works with filesystem, however, it didn't work on my project.
                First I have put audio in resource and tried with:
                @
                MediaPlayer {
                id:movingSound
                volume: 1.0
                source: "qrc:///audio/move.wav"
                }
                @
                No error, but no sound heard.

                then, I have put it using bar-descriptor:
                @
                <asset path="%SRC_DIR%/audio">audio</asset>
                @

                and then used:
                @
                source: "../../audio/move.wav" (qml file was in qml/ProjectDir)
                @
                and I got same result: no error, but no sound heard.

                So how can I get sound worked?

                Qt Ambassador
                Real-time cooperative teams: http://www.softairrealfight.net
                Free Real-time network platform sdk: https://github.com/AlterX76/Solomon

                https://codereview.qt-project.org/...

                1 Reply Last reply
                0
                • VladimirMinenkoV Offline
                  VladimirMinenkoV Offline
                  VladimirMinenko
                  wrote on last edited by
                  #8

                  Do other audio files work? Can you please open an issue on the Qt Bugreports for QtPorts:BB10 and attach this wav file? It is important to attach the file, since MediaPlayer generally does work on BB10, even though there are a few other issues around QtMultiedia to be fixed. Thanks!

                  --
                  Vladimir

                  1 Reply Last reply
                  0
                  • A Offline
                    A Offline
                    AlterX
                    wrote on last edited by
                    #9

                    Ok no problem

                    Qt Ambassador
                    Real-time cooperative teams: http://www.softairrealfight.net
                    Free Real-time network platform sdk: https://github.com/AlterX76/Solomon

                    https://codereview.qt-project.org/...

                    1 Reply Last reply
                    0
                    • A Offline
                      A Offline
                      AlterX
                      wrote on last edited by
                      #10

                      Vladimir, I have attached audio clip to this already opened bug:
                      "here":https://bugreports.qt-project.org/browse/QTBUG-37626

                      Qt Ambassador
                      Real-time cooperative teams: http://www.softairrealfight.net
                      Free Real-time network platform sdk: https://github.com/AlterX76/Solomon

                      https://codereview.qt-project.org/...

                      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