Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: Easy way to do sound?

  1. #1
    Member Contributor
    Join Date
    Mar 2000
    Posts
    94

    Easy way to do sound?

    Is there a simple way(for a beginner) to use sound(of any type in Opengl under Windows9 I've written a very simple bouncing ball type game and would like to add some sound effects...I'm not an advanced Opengl or c++ programer which is why I've asked for a simple technique...It doesn't have to be efficient or do any error checking. I can't sem to find anything on the internet about this...

  2. #2
    Senior Member OpenGL Guru Humus's Avatar
    Join Date
    Mar 2000
    Location
    Stockholm, Sweden
    Posts
    2,342

    Re: Easy way to do sound?

    Hmmm ... doesn't seam to belong to an OpenGL board ...
    However, the easiest way to do sound i guess is to use the standard windows function PlaySound. Just give it the name of a wavfile and it plays it.

  3. #3
    Senior Member OpenGL Guru
    Join Date
    Feb 2000
    Location
    Sweden
    Posts
    2,978

    Re: Easy way to do sound?

    Hello

    There is a new API called OpenAL (open audio library), http://www.openal.org . It's a API simlilar to OpenGL, and it's supposed to be working on most platforms supporting OpenGL. Maybe it's worth a try.

    Bob

  4. #4
    Guest

    Re: Easy way to do sound?

    dude, I still get unresolved external error, is there something I should link to get PlaySound to work?

    I took a simple windows program that worked!
    and added PlaySound in it with #include <mmsystem.h>

    what am I doing wrong!!?!?!?!

  5. #5
    Member Contributor
    Join Date
    Mar 2000
    Posts
    94

    Re: Easy way to do sound?

    Thanks for the help....
    just type...
    PlaySound("pinball4.wav", NULL, SND_ASYNC|SND_FILENAME);

    And sound works....

  6. #6
    Guest

    Re: Easy way to do sound?

    I still get an unresolved external

    even w/
    PlaySound("chimes.wav", NULL, SND_ASYNC|SND_FILENAME); //chimes.wav is in the directory

    I placed it it WinMain...

    here is the error i get:

    Compiling...
    sound.cpp
    Linking...
    sound.obj : error LNK2001: unresolved external symbol __imp__PlaySoundA@12
    Debug/sound.exe : fatal error LNK1120: 1 unresolved externals
    Error executing link.exe.

  7. #7
    Senior Member OpenGL Guru
    Join Date
    Feb 2000
    Location
    Sweden
    Posts
    2,978

    Re: Easy way to do sound?

    It looks like you forgot to add a library. Try to add winmm.lib to your project.

    It's called winmm.lib in MSVC, dunno if it's called the same in other environments.

    Bob

  8. #8
    Guest

    Re: Easy way to do sound?

    thanks, for some really wierd reason... it works without the lib now

  9. #9
    Guest

    Re: Easy way to do sound?

    where do you put the code and when is the sound supposed to play.... because i am hearing nothing... and yes the volume is turned up

  10. #10
    Guest

    Re: Easy way to do sound?

    Also if you want to play mp3 music or something i can recommend Bass library...

    You can get it at www.un4seen.com

Page 1 of 2 12 LastLast

Similar Threads

  1. Playing Sound Or adding Sound to OpenGl file
    By GangaPatil in forum OpenGL: Basic Coding
    Replies: 5
    Last Post: 04-26-2014, 12:17 PM
  2. how to add sound?
    By in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 04-03-2004, 09:17 PM
  3. sound
    By tonka in forum OpenGL: User Software
    Replies: 2
    Last Post: 07-14-2003, 01:11 AM
  4. sound
    By Dentist in forum OpenGL: Basic Coding
    Replies: 3
    Last Post: 03-15-2002, 05:40 PM
  5. Sound lib
    By Caesar in forum OpenGL: Advanced Coding
    Replies: 1
    Last Post: 10-19-2000, 08: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