aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2011-05-15 00:18:28 -0700
committerChris Robinson <[email protected]>2011-05-15 00:18:28 -0700
commit949cfe2ceb7ada5f7ab9b1ad9df795c817717b82 (patch)
tree5a8392ea6d927dded5fcbbc1c4a6b432b3ce110b
parentc39f27d5f89f278a09b05f3dfdc9a3f245a0f9af (diff)
Re-enable duplication for stereo sounds
-rw-r--r--Alc/ALu.c19
-rw-r--r--alsoftrc.sample15
2 files changed, 26 insertions, 8 deletions
diff --git a/Alc/ALu.c b/Alc/ALu.c
index f5e585ed..7d1805fc 100644
--- a/Alc/ALu.c
+++ b/Alc/ALu.c
@@ -213,6 +213,25 @@ ALvoid CalcNonAttnSourceParams(ALsource *ALSource, const ALCcontext *ALContext)
}
}
}
+ else if((ALContext->Device->Flags&DEVICE_DUPLICATE_STEREO))
+ {
+ static const ALfloat angles_StereoDup[4] = { -30.0f, -150.0f,
+ 30.0f, 150.0f };
+ DryGain *= aluSqrt(2.0f/4.0f);
+ for(c = 0;c < 4;c++)
+ {
+ pos = aluCart2LUTpos(cos(angles_StereoDup[c] * (M_PI/180.0)),
+ sin(angles_StereoDup[c] * (M_PI/180.0)));
+ SpeakerGain = &Device->PanningLUT[MAXCHANNELS * pos];
+
+ for(i = 0;i < (ALint)Device->NumChan;i++)
+ {
+ Channel chan = Device->Speaker2Chan[i];
+ SrcMatrix[c>>1][chan] += DryGain * ListenerGain *
+ SpeakerGain[chan];
+ }
+ }
+ }
else
{
for(c = 0;c < 2;c++)
diff --git a/alsoftrc.sample b/alsoftrc.sample
index 87ac2198..c1ec67f7 100644
--- a/alsoftrc.sample
+++ b/alsoftrc.sample
@@ -93,14 +93,13 @@
#sources = 256
## stereodup:
-# Sets whether to duplicate stereo sounds on the rear and side speakers for 4+
-# channel output. This provides a "fuller" playback quality for 4+ channel
-# output modes, although each individual speaker will have a slight reduction
-# in volume to compensate for the extra output speakers. True, yes, on, and
-# non-0 values will duplicate stereo sources. 0 and anything else will cause
-# stereo sounds to only play out the front speakers. This only has an effect
-# when a suitable output format is used (ie. those that contain side and/or
-# rear speakers).
+# Sets whether to duplicate stereo sounds behind the listener for 4+ channel
+# output. This provides a "fuller" playback quality for surround sound output
+# modes, although each individual speaker will have a slight reduction in
+# volume to compensate for the extra output speakers. True, yes, on, and non-0
+# values will duplicate stereo sources. 0 and anything else will cause stereo
+# sounds to only play in front. This only has an effect when a suitable output
+# format is used (ie. those that contain side and/or rear speakers).
#stereodup = true
## scalemix: