mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 04:07:44 +00:00
AudioServer: Add a "main mix volume" and a simple program to get/set it
Give the mixer a main volume value (percent) that we scale all the outgoing samples by (before clipping.) Also add a simple "avol" program for querying and setting the volume: - "avol" prints the current volume. - "avol 200" sets the main mix volume to 200%
This commit is contained in:
parent
2feddc58bb
commit
15afc88ffe
8 changed files with 72 additions and 0 deletions
|
@ -71,6 +71,8 @@ void ASMixer::mix()
|
|||
|
||||
for (int i = 0; i < mixed_buffer_length; ++i) {
|
||||
auto& mixed_sample = mixed_buffer[i];
|
||||
|
||||
mixed_sample.scale(m_main_volume);
|
||||
mixed_sample.clip();
|
||||
|
||||
i16 out_sample;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue