sound?

This is a discussion on sound? within the Linux Programming forums, part of the Platform Specific Boards category; Hei guys, I'm now writing a little GUI game using KDevelop 2.1.3. I want to have background music in my ...

  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, 12:58 AM
  3. Updated sound engine code
    By VirtualAce in forum Game Programming
    Replies: 8
    Last Post: 11-18-2004, 11:38 AM
  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, 02:34 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21