From 9a28402b90c596ccdc7d1a4ee93f5711637bb484 Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Mon, 2 May 2011 18:33:32 -0700 Subject: Fix non-spatialized mono sources --- Alc/ALu.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'Alc') diff --git a/Alc/ALu.c b/Alc/ALu.c index 80fb1d1a..07eb9315 100644 --- a/Alc/ALu.c +++ b/Alc/ALu.c @@ -158,7 +158,21 @@ ALvoid CalcNonAttnSourceParams(ALsource *ALSource, const ALCcontext *ALContext) switch(Channels) { case FmtMono: - SrcMatrix[0][FRONT_CENTER] = DryGain * ListenerGain; + if((ALContext->Device->Flags&DEVICE_USE_HRTF)) + { + const ALshort *hrtf_left, *hrtf_right; + + GetHrtfCoeffs(0.0, 0.0, &hrtf_left, &hrtf_right); + for(i = 0;i < HRTF_LENGTH;i++) + { + ALSource->Params.HrtfCoeffs[0][i][0] = + hrtf_left[i]*(1.0/32767.0)*DryGain*ListenerGain; + ALSource->Params.HrtfCoeffs[0][i][1] = + hrtf_right[i]*(1.0/32767.0)*DryGain*ListenerGain; + } + } + else + SrcMatrix[0][FRONT_CENTER] = DryGain * ListenerGain; break; case FmtStereo: if((ALContext->Device->Flags&DEVICE_USE_HRTF)) -- cgit v1.2.3