Active Topics

 


Reply
Thread Tools
Posts: 13 | Thanked: 0 times | Joined on May 2010
#1
I have a very noob question. I'm just starting out learning Qt and I'm trying to figure out how to add sound files into the build process for the N900. I'm using the latest Qt Creator running on Win7.

I created the project using the Maemo 5 template, this added some automated deb packaging stuff into the project. In the app I'm writing, I calling a small wav file & playing it with Qsound. This works fine when running it in the Simulator. I just drop the wav file in the build folder.
But I can't figure out how I can include this file into the Maemo build & have it in the deb file that comes out the other end. No matter where I try to put it in the project, the packaging process just ignores it.

Appreciate any help I can get. Thanks.
 
Posts: 1,086 | Thanked: 2,964 times | Joined on Jan 2010
#2
If you run your packaged app on the N900 from Xterm you'll see an error message, it will tell you if the file is not found and what the path it expects it to find the sound file in

Easiest way might be to add your sound file to the Qt resources file (.rc) of your project and just point to that when you want to play the sound.
__________________
Follow me on my neglected twitter @kojacker

Cybot950 - Control a robot with your N9/N950
SMSPetFeeder - Build a Bluetooth/SMS dog feeder with Qt, N950, and arduino
Nerf950 - Use your N9/N950 to fire a Nerf gun
 
Posts: 13 | Thanked: 0 times | Joined on May 2010
#3
I could manually copy the wav file to where it expects, but the issues is the build process that creates the deb file will not include it.

For some reason QSound does not support getting media from the resource file, only from a external file. What I can't figure out is how to make this wav file part of the project so it 'will' be built into the deb.

I know I could use QtMultimedia or phonon to do it. But it just seems like overkill for such a simple thing.
 
Posts: 435 | Thanked: 769 times | Joined on Apr 2010
#4
To include a file to be shipped within your deb, go to your qt creator project file and add this:

maemo5 {
MYFILE.files = MYFILENAME
MYFILE.path = /opt/MYAPPNAME/
INSTALLS += MYFILE
}

QtCreator starts looking for your files inside source dir. You must give it full name, estension included.

Throw away QSound, if I don't remember wrong it's not even available on maemo. Use QSound::isAvailable() public static method to check it.
 

The Following User Says Thank You to gionni88 For This Useful Post:
Posts: 13 | Thanked: 0 times | Joined on May 2010
#5
I see now. Thanks for that.

Well, you are right, it does not play in Maemo. That sucks.
So should I use QMediaPlayer or Phonon?
 
Reply


 
Forum Jump


All times are GMT. The time now is 05:10.