1
0
Fork 0
mirror of https://github.com/AquariaOSE/Aquaria.git synced 2025-10-06 06:10:45 +00:00

Implement stereo to mono mixing for proper L/R separation even for stereo samples.

This mixes only those sounds that are supposed to be played positional.
All centered (default) sounds are played in stereo, as usual.
This commit is contained in:
fgenesis 2013-07-24 19:57:13 +02:00
commit cf6556b94d
5 changed files with 51 additions and 14 deletions

View file

@ -1158,9 +1158,9 @@ void *SoundManager::playSfx(const PlaySfx &play)
// distance gain attenuation: stereo separation + silence at further away than maxdist
float maxdist = play.maxdist;
if (!maxdist)
maxdist = 1300;
maxdist = 1800;
if(maxdist > 0)
if(maxdist > 0 && play.positional)
channel->set3DMinMaxDistance(maxdist * 0.3, maxdist); // HACK: this works reasonably well
else
channel->set3DMinMaxDistance(0, 0); // no attenuation