Skip to content
Snippets Groups Projects
Commit 6851e932 authored by Liam's avatar Liam
Browse files

audio: skip coefficient normalization for downmix

parent ffbba74c
No related branches found
No related tags found
No related merge requests found
...@@ -42,11 +42,9 @@ void SinkStream::AppendBuffer(SinkBuffer& buffer, std::span<s16> samples) { ...@@ -42,11 +42,9 @@ void SinkStream::AppendBuffer(SinkBuffer& buffer, std::span<s16> samples) {
// We're given 6 channels, but our device only outputs 2, so downmix. // We're given 6 channels, but our device only outputs 2, so downmix.
// Front = 1.0 // Front = 1.0
// Center = 0.596 // Center = 0.596
// Back = 0.707
// LFE = 0.354 // LFE = 0.354
// 1.0 + 0.596 + 0.707 + 0.354 = 2.657, 1/2.657 = 0.37636f downscale coefficient // Back = 0.707
static constexpr std::array<f32, 4> down_mix_coeff{0.37636f, 0.22431056f, 0.13323144f, static constexpr std::array<f32, 4> down_mix_coeff{1.0, 0.596f, 0.354f, 0.707f};
0.26608652f};
for (u32 read_index = 0, write_index = 0; read_index < samples.size(); for (u32 read_index = 0, write_index = 0; read_index < samples.size();
read_index += system_channels, write_index += device_channels) { read_index += system_channels, write_index += device_channels) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment