DirectSound Mixer Sample
DirectSound Mixer or DSMixer helps you create many DirectSound PCM wave secondary buffers and play them together.
This sample is based on the CodeGuru StackUp game sample by Tool@theWaterCooler.com
The main part of this sample is the CDSBuffer class which wraps the DirectSoundBuffer Object. New buffers can be created by supplying the (wave) file name in the constructor. CDSBuffer is derived from CObject. This helps in maintaining all these buffer in a CObList, or a class derived from CObList like CDSList. CDSList can be described as the class that wraps the DirectSound Object. To use this class, the Init() member function should be called to create the DirectSound Object and set the cooperative level. Here DirectSoundCreate() has been used rather than CoCreateInstance() to create the DirectSound Object.
One can mix sounds from different CDSBuffer instances simply by playing them at the same time. Data from CDSBuffer instances is mixed by DirectSound in the primary buffer. Any number of CDSBuffer instances can be played at one time, up to the limits of processing power.
Basic 3D Buffer support is also built into the CDSBuffer class. The buffer can be moved around and placed in an abitary position in 3D space. Similarly, the velocity of the buffer can also be set to generate sound effects due to doppler effect.
To create a CDSBuffer object a pointer to the DirectSound Object (LPDIRECTSOUND) is to be supplied and a CDSList instance can provide this. Alternatively to take use of MFC's Doc-View architecture a CDSBuffer instance can be defined in the CDocument derived class and something similar to CDSList can be maintained in the CWinApp derived application class. This is the way things have been done in the accompanying demo project.
The source code was built and tested with Visual C++ 6.0 and DirectX 6 in Windows 98 and Windows NT 4.0 (with Internet Explorer 4.0) on Intel platform.

Comments
undefine DSBCAPS_CTRLDEFAULT
Posted by wave826 on 12/18/2009 10:37pmconvert to VC2005,error report undefine DSBCAPS_CTRLDEFAULT. why? thk!
ReplyI whould like to learn how to use DirectSoundFullDuplex Object
Posted by Legacy on 03/27/2003 12:00amOriginally posted by: Aquatic
I�m a beginner in DirectSound and I whant to setup a a full duplex audio system with DirectSound 9 with directSoundFullDuplex Object but I don�t kno how.
Help me please ;)
Replythanks
Voice recognition
Posted by Legacy on 10/21/2002 12:00amOriginally posted by: Oyster
Recently, i was carry out a project which using Visual C++ to capture the user voice through a microphone and than transformit into text form. Is it anybody here can give me some ideal on how to code it?or anybody is experience in this field can give me a hand. Thank you very much.
-
ReplyErgent!!! SOS!!! Need Help!!!
Posted by crazywhale on 06/12/2008 05:55amI want to write a program for the voice recognition and this program is use to control a control car.Can you give me a example to write this type of program. if can, can you send it to my email address, thanks.My email address is xiao_hui1016@hotmail.com. Hope can get the information as soon as possible. Thanks you so much.
ReplySolution to the DSBCAPS_CTRLDEFAULT problem
Posted by Legacy on 08/02/2002 12:00amOriginally posted by: Etienne
ReplyVisual Basic Project For Calling Sounds and Pictures
Posted by Legacy on 04/22/2002 12:00amOriginally posted by: Gbolahan Oduyiga
I am presently working of a Sound /picture project which is to be interfaced with visual basic. I have been on this project since and I have a deadline which is just about three days after today. The visual basic programme is meant to call the pictures and the sounds for instance when a particular sound is played, a picture flashes out to compliment it. Please I would like you to send me vbcodes necessary to implement this project and i will aslo appreciate it if samples of similar project can be sent to me.
Thanks so much for your help
Gbolahan.
ReplyDirectx Installed or not
Posted by Legacy on 01/03/2002 12:00amOriginally posted by: Sharma
Hi,
ReplyCould u tell me if there is a DirectX Api that helps to find if Directx is installed on the system or not.
thanx
Tell me more about DIRECTSOUNDNOTIFY
Posted by Legacy on 11/08/2001 12:00amOriginally posted by: li_zuo_min
I want to use DIRECTSOUNDNOTIFY,but i am not amiliar
Replywith it. help me! if you can ,give me a sample.
My address : li_zuo_min@sina.com
How to play captured sounds?
Posted by Legacy on 10/17/2001 12:00amOriginally posted by: Claudio
Hi to everyone.
I would like to capture a sound from a microphone and I want to play it without delay,or only few milliseconds.
In a second time I would like to add an echo effect.
Has anyone any advice for me?
ReplyThanks in advance,
Claudio
Siena - Italy
Does Not Compile, DSBCAPS_CTRLDEFAULT Undefined
Posted by Legacy on 08/22/2001 12:00amOriginally posted by: Franklin
ReplyDoes Not Compile, DSBCAPS_CTRLDEFAULT Undefined
Posted by Legacy on 08/22/2001 12:00amOriginally posted by: Franklin
Hi this code does not compile, The Compiler reports that DSBCAPS_CTRLDEFAULT is not defined. How do I over come this Problem. Help!!!!!
Thanks in Advance
ReplyFranklin
Loading, Please Wait ...