Hei guys,
I'm now writing a little GUI game using KDevelop 2.1.3. I want to have background music in my game, but program fails to play any file at all. Here is a piece of my code:
//---------------------------------
//...
#include <qsound.h>
{//...
QSound::play("sound/music.wav");
//...
}
//...
//---------------------------------
I can't see what's wrong with that, but I've tried also something similar:
//---------------------------------
//...
#include <qsound.h>
{//...
QSound *player=new QSound("sound/music.wav")
if(!player->available())
{
//...
}
player->play();
//...
}
//...
//---------------------------------
But that doesn't help and each time available()==false.
What am I doing wrong? Are there any other ways to play soundfiles?