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...
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
check it out at www.openal.org
The "PlaySound" function defined in <mmsystem.h> may do well for your purpose.
It's as simple as that:
for playing wavefiles directly.
for playing a wavefile loaded into memory.
For more complex stuff (e.g. surround-sound etc.) you'll have to stick to DirectSound.
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 ...).