-
Junior Member
Regular Contributor
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...
-
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
-
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.
-
Junior Member
Regular Contributor
-
Junior Member
Regular Contributor
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
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