-
Easy way to do sound?
Is there a simple way(for a beginner) to use sound(of any type in Opengl under Windows98) 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...
-
Senior Member
OpenGL Guru
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.
-
Senior Member
OpenGL Guru
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
-
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!!?!?!?!
-
Re: Easy way to do sound?
Thanks for the help....
just type...
PlaySound("pinball4.wav", NULL, SND_ASYNC|SND_FILENAME);
And sound works....
-
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.
-
Senior Member
OpenGL Guru
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
-
Re: Easy way to do sound?
thanks, for some really wierd reason... it works without the lib now
-
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
-
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
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules