DevMaster.net Forums
[[ Home | Forums | 3D Engines Database | Wiki | Articles/Tutorials | Game Dev Jobs | IRC Chat Network | Contact Us ]]

Go Back   DevMaster.net Forums > Programming & Development > Sound and Music Programming
User Name
Password
Register FAQ Members List Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Search this Thread Display Modes
Old 06-24-2006, 08:32 PM   #1
code2K
New Member
 
Join Date: Jun 2006
Posts: 10
Lightbulb Sharing 1 sound buffer between 2 DirectSound objects

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.
code2K is offline   Reply With Quote
Old 06-25-2006, 08:39 AM   #2
Jare
Valued Member
 
Join Date: Oct 2005
Posts: 247
Default Re: Sharing 1 sound buffer between 2 DirectSound objects

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.
___________________________________________
http://www.iguanademos.com/Jare
Jare is offline   Reply With Quote
Old 06-26-2006, 12:46 AM   #3
juhnu
Valued Member
 
Join Date: Aug 2005
Location: Seoul
Posts: 272
Default Re: Sharing 1 sound buffer between 2 DirectSound objects

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.
juhnu is offline   Reply With Quote
Old 06-26-2006, 03:12 PM   #4
code2K
New Member
 
Join Date: Jun 2006
Posts: 10
Default Re: Sharing 1 sound buffer between 2 DirectSound objects

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.
code2K is offline   Reply With Quote
Old 06-26-2006, 03:29 PM   #5
code2K
New Member
 
Join Date: Jun 2006
Posts: 10
Default Re: Sharing 1 sound buffer between 2 DirectSound objects

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.
code2K is offline   Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Forum Jump


All times are GMT -7. The time now is 12:19 PM.


Powered by vBulletin
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.