Results 1 to 5 of 5

Thread: sounds

  1. #1
    Senior Member Regular Contributor
    Join Date
    Feb 2000
    Location
    Sweden
    Posts
    102

    sounds

    How do I play sounds in CPP? Whats the command? I know it ain't a opengl question, but usually game programmers know much about this stuff too...

    I hope so anyway...
    CyBBe

  2. #2
    Member Contributor
    Join Date
    Feb 2000
    Location
    San Diego Ca, USA
    Posts
    50

    Re: sounds

    you have to have a sound library to handle all of the necessary routines...
    either you code one yourself or you use one
    written by someone else

    DirectSound is an probably a good choice
    if your coding for Win32.. there are others
    for different platforms

    there is also a promising library that is
    being built which is very similar in concept
    to OpenGL - its a cross platform 3D library
    for sound
    check it out at www.openal.org

  3. #3
    Member Contributor
    Join Date
    Feb 2000
    Location
    Germany
    Posts
    87

    Re: sounds

    The "PlaySound" function defined in <mmsystem.h> may do well for your purpose.
    It's as simple as that:
    - PlaySound("wavefile.wav",0,SND_ASYNC|SND_FILENAME)
    for playing wavefiles directly.
    - PlaySound((char*)snd_addr,0,SND_ASYNC|SND_MEMORY)
    for playing a wavefile loaded into memory.
    For more complex stuff (e.g. surround-sound etc.) you'll have to stick to DirectSound.

  4. #4
    Senior Member Regular Contributor
    Join Date
    Feb 2000
    Location
    Sweden
    Posts
    102

    Re: sounds

    thanx, I'll try that...
    CyBBe

  5. #5
    Senior Member Regular Contributor
    Join Date
    Feb 2000
    Posts
    122

    Re: sounds

    For playing digital music, you can use the Midas Sound System. This library can play the *.MOD *.S3M *.IT *.XM ... music-formats. I think it is able to play single sounds, too. Setup is really simple but if you like you can also choose, which sound output should be used (DirectSound ...).

    Marc

Similar Threads

  1. Sounds and stuff
    By in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 03-13-2004, 10:10 AM
  2. Music & Sounds in OpenGL
    By Explosive_Ice in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 12-10-2003, 05:12 AM
  3. BEST way to do sounds
    By Structural in forum OpenGL: Basic Coding
    Replies: 8
    Last Post: 01-13-2003, 11:42 PM
  4. playing sounds in IRIX
    By in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 05-04-2001, 12:55 AM
  5. Sounds?
    By CyBBe in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 03-09-2000, 04:54 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Proudly hosted by Digital Ocean