Archived

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

jason hirst

DirectSound secondary buffer management

Recommended Posts

jason hirst    122
Hi Guys, I''m working on developing a simple DirectSound interface to play sounds in a project I''m working on. My question is in regards to the correct (or optimal) time to create secondary buffers to play the sounds in. If I''m maintaining a list of all the sounds in memory up to some maximum amount (my interface requires the registration of a sound before playing it), would it be better to create the secondary buffers when the sound is requested to start playing? I.e. Play(...) would create the buffer, copy the sound data in, play the sound then delete the buffer. Or would it be better to allocate a set number of buffers at initialization time and then when Play is called load the data into the buffer and start playing it? If I do allocate a set number of buffers at program load what would be a reasonable amount to work with? Would allocating 32 or so be too greedy on the part of my program (or flat out unnecessary)?

Share this post


Link to post
Share on other sites