1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 01:47:34 +00:00

Audio: Add per-client volume

Note: While ClientAudioStream has had a volume property, it is only now
used in the mixer.
This commit is contained in:
kleines Filmröllchen 2021-08-27 23:57:02 +02:00 committed by Andreas Kling
parent 5300c9e6b4
commit bd17da9f9e
7 changed files with 33 additions and 1 deletions

View file

@ -88,6 +88,7 @@ void Mixer::mix()
continue;
}
++active_queues;
queue->volume().advance_time();
for (int i = 0; i < mixed_buffer_length; ++i) {
auto& mixed_sample = mixed_buffer[i];
@ -95,6 +96,7 @@ void Mixer::mix()
if (!queue->get_next_sample(sample))
break;
sample.log_multiply(SAMPLE_HEADROOM);
sample.log_multiply(queue->volume());
mixed_sample += sample;
}
}