Advertisement

DSound: Multiple sounds from same wave file

Started by May 27, 2001 03:35 AM
0 comments, last by MothaBrain 23 years, 8 months ago
Hello! I''ve had a headbreaking problem (for me ) the last day about DirectSound. The SDK samples somehow work around and I couldn''t find another nice way. (It''s still DX6, but I think it''s more a principle than a software problem) I know that to play a sound - let''s say an engine in a car - I must create a secondary buffer, load wave data ... and play it. It''ll be mixed in the primary buffer. So far so good Now my problem arises. What to do if I have 5 cars (all with the same engine sound). I don''t want to load the same wave file in memory 5 times, but how can I avoid this if every sound that is played has to have it''s own sound buffer? I thought maybe it would possible to load all wave files that are needed in a buffer object once for every wave and than use DuplicateBuffer (or how it''s called ) for the playing sound so it doesnt need to allocate new memory. (i.e. refer to the wave memory) But I read in the SDK doc that it _might_ not work all time - so it seems quite useful How is this issue handled in other games? I would be thanksful for every help. Ciao!
Have a look at our game "Crashday" at www.moonbyte.de
hmm you can duplicate the buffer pointer or something
here is a tutorial i wrote it might be helpful

let''s rock!


good luck

Arkon
[QSoft Systems]

This topic is closed to new replies.

Advertisement