summaryrefslogtreecommitdiff
path: root/src/audio_core/sink
diff options
context:
space:
mode:
authorGravatar Liam2023-12-16 12:54:40 -0500
committerGravatar Liam2023-12-16 13:05:55 -0500
commit6851e93296969e1f990ebc12e2a46026dc34ccce (patch)
treeb782dec695de2baab62b6e1f5a1acb2f3cb88fcf /src/audio_core/sink
parentHave GetActiveChannelCount return the system channels instead of host device ... (diff)
downloadyuzu-6851e93296969e1f990ebc12e2a46026dc34ccce.tar.gz
yuzu-6851e93296969e1f990ebc12e2a46026dc34ccce.tar.xz
yuzu-6851e93296969e1f990ebc12e2a46026dc34ccce.zip
audio: skip coefficient normalization for downmix
Diffstat (limited to 'src/audio_core/sink')
-rw-r--r--src/audio_core/sink/sink_stream.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/audio_core/sink/sink_stream.cpp b/src/audio_core/sink/sink_stream.cpp
index 97866f417..c047b0668 100644
--- a/src/audio_core/sink/sink_stream.cpp
+++ b/src/audio_core/sink/sink_stream.cpp
@@ -42,11 +42,9 @@ void SinkStream::AppendBuffer(SinkBuffer& buffer, std::span<s16> samples) {
42 // We're given 6 channels, but our device only outputs 2, so downmix. 42 // We're given 6 channels, but our device only outputs 2, so downmix.
43 // Front = 1.0 43 // Front = 1.0
44 // Center = 0.596 44 // Center = 0.596
45 // Back = 0.707
46 // LFE = 0.354 45 // LFE = 0.354
47 // 1.0 + 0.596 + 0.707 + 0.354 = 2.657, 1/2.657 = 0.37636f downscale coefficient 46 // Back = 0.707
48 static constexpr std::array<f32, 4> down_mix_coeff{0.37636f, 0.22431056f, 0.13323144f, 47 static constexpr std::array<f32, 4> down_mix_coeff{1.0, 0.596f, 0.354f, 0.707f};
49 0.26608652f};
50 48
51 for (u32 read_index = 0, write_index = 0; read_index < samples.size(); 49 for (u32 read_index = 0, write_index = 0; read_index < samples.size();
52 read_index += system_channels, write_index += device_channels) { 50 read_index += system_channels, write_index += device_channels) {