RE: Sound

Brian Hook <[email protected]> Mon, 16 May 2005 15:40:32 -0400
Newsgroups gmane.games.devel.general
Message-ID <2005516154032.334717@GATEWAY>
> was noticeably louder. I'm toying with the idea of using the slider
> based off of distance as well as sample amplitude. I'll let you
> know how that goes!

What I've done in the past, which is cheap and easy but a gross hack, 
is to track the number of live sounds and use that as an amplitude 
modulation factor.

The problem is that it's possible to have two sounds that sum to more 
power than 32 sounds, but on average 32 sounds will be louder than 2 
sounds, but not 32 times louder*.  So you don't want to just scale by 
(32-n)/32 (the number of active sounds), since that will drop off 
volume far too quickly.

And it's still prone to failing in edge conditions.  

There really is no perfect way to get around it -- you have a fixed 
maximum range that can be exceeded, and you can't predict with 100% 
accuracy when this will happen without introducing latency and using 
some kind of real-time compression/limiting.  Latency sucks for games, 
and real-time compression/limiting is expensive.

FWIW, I don't believe any hardware mixers solve this problem either.

Brian

* Insert standard tangent about power, volume, and loudness -- by 
louder I mean "32 times greater amplitude".





-------------------------------------------------------
This SF.Net email is sponsored by Oracle Space Sweepstakes
Want to be the first software developer in space?
Enter now for the Oracle Space Sweepstakes!
http://ads.osdn.com/?ad_idt12&alloc_id344&op=click
_______________________________________________
Gamedevlists-general mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gamedevlists-general
Archives:
http://sourceforge.net/mailarchive/forum.php?forum_idU7