Thread: sound?

  1. #1
    Registered User MathFan's Avatar
    Join Date
    Apr 2002
    Posts
    190

    sound?

    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?

  2. #2
    Registered User
    Join Date
    Aug 2001
    Posts
    202
    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

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Sound lags in multi-thread version
    By VirtualAce in forum Game Programming
    Replies: 23
    Last Post: 08-27-2008, 11:54 AM
  2. Low latency sound effects
    By VirtualAce in forum Game Programming
    Replies: 0
    Last Post: 12-21-2004, 01:58 AM
  3. Updated sound engine code
    By VirtualAce in forum Game Programming
    Replies: 8
    Last Post: 11-18-2004, 12:38 PM
  4. Help me modify my Sound Server
    By zdude in forum C Programming
    Replies: 1
    Last Post: 05-14-2003, 05:15 PM
  5. sounds?
    By BODYBUILDNERD in forum C++ Programming
    Replies: 6
    Last Post: 12-06-2002, 03:34 PM