"assets://audio/Untitled.mp3"And put your Untitled.mp3 under the assets repositiory like :
--
You received this message because you are subscribed to the Google Groups "android-qt" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-qt+...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
It can be there - I just has no access to the source code atm...
So, I have to create audio folder in assets folder, copy there sound files and done?
Mériadeg Perrinel írta ekkor: 2013.09.25. 17:35
Audio {
id: playMusic
source: "qrc:/mymusic.mp3"
}Audio {
...
This is a part of my app repository
myApp/
myApp/myApp.pro
myApp/mymusic.mp3
myApp/ressource.qrc
myApp/qml/myApp/main.qml
Of course mymusic.mp3 is on my ressource.qrc
With the desktop version, my sound is loaded and can be played.
With the android version, I have two behaviour:
1) The first one is that for the Android device that is connected to my computer and recognized by QtCreator, so the one use for the android compilation and deployment toolchain,
that works too.
2) The myApp.apk generated should be normally the same as the one installed by the toolchain on my Android device, but it seems to be wrong.
So If I completely removed the installed version of my device and installed again by myself the myApp.apk the mp3 isn't loaded (the graphics part of the app works).
This behaviour can be reproduced on Samsung SIII, Samsung SII, LG F6, bluestack
To bypass the problem with Android, I have to do two thing:
1) Change my app repository to:
myApp/
myApp/myApp.pro
myApp/ressource.qrc
myApp/qml/myApp/main.qml
myApp/qml/myApp/mymusic.mp3
2) Then change my code to:
...
id: playMusic
source: "mymusic.mp3"
}
...
Of course in this case, mymusic.mp3 don't needs to be in the qrc
So that works for Android because in the myApp.apk, the mp3 is copied next to the main.qml
It's not cross platform...
If you have more info about all of this feel free to answer here
Meriadeg