Archived

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

Galileo430

Playing A DirectSound Buffer Twice

Recommended Posts

I was wondering if there was a way I could play a single DirectSound buffer while it''s already playing in order to create 2 sounds in the primary buffer?

Share this post


Link to post
Share on other sites
DuplicateSoundBuffer is the call you need. This makes a copy of the buffer (without actually copying the wav data - theoretically) so you can issue a Play command on the new version.

Cheers,
John

Share this post


Link to post
Share on other sites
Hm... DX Audio(Dx8) does in automaticly. Atleast I don''t have to do any sound duplications and it works like a charm

/MindWipe

"If it doesn''t fit, force it; if it breaks, it needed replacement anyway."

Share this post


Link to post
Share on other sites
DuplicateSoundBuffer doesn''t double the memory required for the sound. It doesn''t make a duplicate copy of the sound itself, it just creates another play pointer that references the same wav data.
You get another LPDIRECTSOUNDBUFFER, but that''s just a copy of the interface, not the sound data.
You''re good to go.

Share this post


Link to post
Share on other sites