MediaPlayer and sounds not in resource



  • 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!?



  • 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



  • 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.



  • 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.



  • 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 ?



  • 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... :-)



  • 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?



  • 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!



  • Ok no problem



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


Log in to reply