PDA

View Full Version : sound?



MathFan
03-02-2003, 10:06 AM
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?

starX
03-04-2003, 04:49 AM
I've been doing a bit of sound programming myself of late using the Open Sound System (www.opensound.com/pguide/). I don't know about qsound, but OSS might be what you're looking for.

starX
www.axisoftime.com