Archived

This topic is now archived and is closed to further replies.

ageny6

Mixing Audio Win32 Style

Recommended Posts

ageny6    122
Lots of documentation in the MSDN talk about the ability to mix two (or more) audio sources together without DX (via the waveout [depending on the OS], via the mixer functions, and/or the incorporated KMixer system software mixer). But, to my great disappointment, no real example show how to play these sounds together. Does anyone have a clue on how to do this or know where I can educate myself? Thanks Jonathan

Share this post


Link to post
Share on other sites
PhilVaz    144
<< Does anyone have a clue on how to do this or know where I can educate myself? >>

Not sure how to do that, I know PlaySound only plays one sound at a time, the second sound interrupts the one playing.

If you want to use DirectSound for mixing sounds, I made a simple demo, about the bare minimum you need to load sounds into buffers and play them using the handy dsutil functions included with DirectX 6 SDK

DirectSoundDemo.cpp EXE

dsutil.h dsutil.cpp

Phil P

Share this post


Link to post
Share on other sites
Guest Anonymous Poster   
Guest Anonymous Poster
Look at the Quake 1 Source code, it''s always a source of inspiration. In snd_win.c, you''ll find something like waveoutopen() or something. Quake uses its own sound mixer (snd_mix.c), it''s very well written, and it''s quite portable.

Share this post


Link to post
Share on other sites
ageny6    122
I''m not sure that using the source code from Quake1 for my purposes is be the best idea in the world, but it definitly gave me a good sense of what they are doing. Thanks

Is there a good article out there that treats the subect of sound mixing?

Jonathan

Share this post


Link to post
Share on other sites