Jump to content
  • Advertisement


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


Managing sounds in a engine (or game)

This topic is 5161 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi; I''ve done some classes to wrap the DirectSound, and now i have a sound class. Let me say that im doing a FPS game (online or not). Every player or npc has some sounds, like footsteps, some talks. Each gun emits sounds when it shots, and the bullets emit sound when collide with something...as u can see, there is a lot of sounds at the same time, but some (or lot of them) are not in the auditive (?) region of the current listener. So, them could be stopped when it comes out of range, and played again when in range, to free some sound channels. Currently i have one linked list (slow, ok, just for testing) for active sounds,and one for the sounds that r stopped. So each frame (could be done less times, eg once for 2 or more frames) i check if any active sound is out of range, and if yes, i pause it and insert it into the stopped list, and do the same thing to the stop list (if r in range, unpause it). But i think its not an ideal solution, but i couldnt find any discussion, tutorial or anything else about it....Any suggestion? Thanx

Share this post

Link to post
Share on other sites
If you have the memory and buffers, load all sounds. If not, DuplcateBuffers as you need new ones. That should be fine. Remember to performance check. With a linked list you might lose more performance that way than you would by lumping more into the sound card. A lot depends on the quantity of sounds. Most sounds cards have a lot of memory nowadays.

Ever wanted to command a starship?

Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!