RE: [GD-General] Sound
Brought to you by:
vexxed72
From: Brian H. <ho...@bo...> - 2005-05-16 21:34:50
|
> 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". |