Hello, I am sending the same music to 2 sound cards simultaneously. I'm using a Direct Sound object per sound card and a Primary and obligatory Secondary buffer on each of these. I would like to economise on mem usage by using the DuplicateBuffer() call to share secondary sound buffer memory, but DuplicateBuffer() fails because the buffers are on separate DirectSound objects. Has anyone heard of a solution to this problem? - perhaps I should create a Primary Buffer with write access on one sound card and just stream the sound to it as the other device plays??? But this seems unnecessarily complicated. Any ideas welcome.
Sharing 1 sound buffer between 2 DirectSound objects
Started by code2K, Jun 25 2006 02:32 AM
4 replies to this topic
#1
Posted 25 June 2006 - 02:32 AM
#2
Posted 25 June 2006 - 02:39 PM
Perhaps there is some way to coerce DirectSound into accepting a SoundBuffer that uses an user-supplied buffer (in software mixing mode, obviously), but I don't see such a capability in the DSBUFFERDESC struct.
#3
Posted 26 June 2006 - 06:46 AM
Are you trying to stream the music to both devices? In that case the buffer sizes are meaningless, as you need only a one buffer per device.
If that's not the case and you really need to lower the memory usage, you could do the mixing in software and then stream the mixed audio to both devices.
If that's not the case and you really need to lower the memory usage, you could do the mixing in software and then stream the mixed audio to both devices.
#4
Posted 26 June 2006 - 09:12 PM
Yes. I've have tried this by using the DSBCAPS_LOCSOFTWARE flag when creating the buffers but unfortunately DuplicateSoundBuffer() only returns successfully (with a duplicated buffer that shares mem of the original)when the buffer being duplicated and the original buffer are on the same DirectSound object(ie the same sound card). Tricky.
#5
Posted 26 June 2006 - 09:29 PM
Yes. Maybe mixing in the software is the only way but ideally I would like to keep the mixing done on the hardware as well.
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users












