diff options
author | Chris Robinson <[email protected]> | 2019-12-29 20:35:47 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2019-12-29 20:35:47 -0800 |
commit | c1cf10f508dfb939bd264c88b075aac9511dc994 (patch) | |
tree | 216cd5147d40201db383641891a5a219a396a315 /alc/alc.cpp | |
parent | 9ac8f25a05ff8fc6950b3056c78d937737baf68f (diff) |
Handle downmixing for mono output
Diffstat (limited to 'alc/alc.cpp')
-rw-r--r-- | alc/alc.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/alc/alc.cpp b/alc/alc.cpp index 125051c8..199934f9 100644 --- a/alc/alc.cpp +++ b/alc/alc.cpp @@ -1416,6 +1416,15 @@ bool IsValidAmbiScaling(ALCenum scaling) * existing ones. Based on Wine's DSound downmix values, which are based on * PulseAudio's. */ +const std::array<InputRemixMap,7> MonoDownmix{{ + { FrontLeft, {{{FrontCenter, 0.5f}, {LFE, 0.0f}}} }, + { FrontRight, {{{FrontCenter, 0.5f}, {LFE, 0.0f}}} }, + { SideLeft, {{{FrontCenter, 0.5f/9.0f}, {LFE, 0.0f}}} }, + { SideRight, {{{FrontCenter, 0.5f/9.0f}, {LFE, 0.0f}}} }, + { BackLeft, {{{FrontCenter, 0.5f/9.0f}, {LFE, 0.0f}}} }, + { BackRight, {{{FrontCenter, 0.5f/9.0f}, {LFE, 0.0f}}} }, + { BackCenter, {{{FrontCenter, 1.0f/9.0f}, {LFE, 0.0f}}} }, +}}; const std::array<InputRemixMap,6> StereoDownmix{{ { FrontCenter, {{{FrontLeft, 0.5f}, {FrontRight, 0.5f}}} }, { SideLeft, {{{FrontLeft, 1.0f/9.0f}, {FrontRight, 0.0f}}} }, @@ -1983,13 +1992,13 @@ static ALCenum UpdateDeviceParams(ALCdevice *device, const ALCint *attrList) switch(device->FmtChans) { + case DevFmtMono: device->RealOut.RemixMap = MonoDownmix; break; case DevFmtStereo: device->RealOut.RemixMap = StereoDownmix; break; case DevFmtQuad: device->RealOut.RemixMap = QuadDownmix; break; case DevFmtX51: device->RealOut.RemixMap = X51Downmix; break; case DevFmtX51Rear: device->RealOut.RemixMap = X51RearDownmix; break; case DevFmtX61: device->RealOut.RemixMap = X61Downmix; break; case DevFmtX71: device->RealOut.RemixMap = X71Downmix; break; - case DevFmtMono: case DevFmtAmbi3D: break; } |