Please respond only if you've DirectSound experience....

Started by
5 comments, last by HanSoL0 21 years, 11 months ago
I''m still workin'' on my DirectSound engine, and I''m having all kinds of pointer array element access troubles. I was wondering how any of you have any tips from your own DirectSound experience, particularly dealing with muliple secondary sound buffers and 3D buffers. Thanks! ~Ryan

Ryan Buhr

Technical Lead | Sector 13

Reactor Interactive, LLC

Facebook | Twitter

Advertisement
You might want to be a bit more specific on the type of problems you are having - code bits, examples, errors, etc.



Jim Adams
home.att.net/~rpgbook
Author, Programming Role-Playing Games with DirectX
Actually, I''m just kind of wondering GENERALLY how you''d design the sound system. Would you declare an array of LPDIRECTSOUND3DBUFFER''s or would you do it some other way? What''s the best method? I''m not really looking for answers to a specific problem, I''m just in a slight quandary about how to design my 3D sound effects engine. Thanks.



Ryan Buhr
Reactor Interactive, LLC.

Ryan Buhr

Technical Lead | Sector 13

Reactor Interactive, LLC

Facebook | Twitter

why dont look at some other sound apis like fmod or bass? while you cant see the actual implementation you can get an idea of what sort of functions you may want to include.
I''ve got a nearly complete game engine that includes Direct3D, DirectInput, and DirectPlay, so I would LIKE to use DirectSound because I already know generally how it works. I''m trying to create a DirectSound wrapper class and I''m just wondering how you would declare your secondary sound buffers. Would you create them in an array, or would you create them individually?

Ryan Buhr
Reactor Interactive, LLC.

Ryan Buhr

Technical Lead | Sector 13

Reactor Interactive, LLC

Facebook | Twitter

The way I designed my sound engine was to create about 4-8 buffers. Load in each sound (or leave on disc for larger sounds), and when it''s time to play, find a buffer that is not playing already, or if all buffers are playing, stop one and use it. Load the sound data into that one buffer you picked and let it play. In that way, you save on buffer memory, and you can play a large amount of sounds with little consequences. You can also use the same technique with DirectMusic if you don''t want to mess with playback formats and streaming directly.

Jim Adams



Jim Adams
home.att.net/~rpgbook
Author, Programming Role-Playing Games with DirectX
Thank you very much, Jim! That''s EXACTLY what I was lookin'' for! This is the reason I''m a HUGE fan of the line of books you wrote for. Thanks again!


Ryan Buhr
Reactor Interactive, LLC.

Ryan Buhr

Technical Lead | Sector 13

Reactor Interactive, LLC

Facebook | Twitter

This topic is closed to new replies.

Advertisement