From 53fadf54977a3312db66e7e086c9b01d9162ae29 Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Tue, 15 Mar 2016 05:08:05 -0700 Subject: Add a dual-band ambisonic decoder This uses a virtual B-Format buffer for mixing, and then uses a dual-band decoder for improved positional quality. This currently only works with first- order output since first-order input (from the AL_EXT_BFROMAT extension) would not sound correct when fed through a second- or third-order decoder. This also does not currently implement near-field compensation since near-field rendering effects are not implemented. --- Alc/ALu.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'Alc/ALu.c') diff --git a/Alc/ALu.c b/Alc/ALu.c index d7f68c03..5064a588 100644 --- a/Alc/ALu.c +++ b/Alc/ALu.c @@ -35,6 +35,7 @@ #include "bs2b.h" #include "hrtf.h" #include "uhjfilter.h" +#include "bformatdec.h" #include "static_assert.h" #include "mixer_defs.h" @@ -1462,6 +1463,13 @@ ALvoid aluMixData(ALCdevice *device, ALvoid *buffer, ALsizei size) device->Hrtf_Offset += SamplesToDo; } } + else if(device->AmbiDecoder) + { + bformatdec_process(device->AmbiDecoder, + device->RealOut.Buffer, device->RealOut.NumChannels, + device->VirtOut.Buffer, SamplesToDo + ); + } else { if(device->Uhj_Encoder) -- cgit v1.2.3