mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-26 09:30:24 +00:00
15afc88ffe
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%
19 lines
414 B
C++
19 lines
414 B
C++
#include <LibAudio/ABuffer.h>
|
|
#include <LibAudio/AClientConnection.h>
|
|
#include <stdio.h>
|
|
|
|
int main(int argc, char** argv)
|
|
{
|
|
CEventLoop loop;
|
|
AClientConnection a_conn;
|
|
a_conn.handshake();
|
|
|
|
if (argc > 1) {
|
|
int new_volume = atoi(argv[1]);
|
|
a_conn.set_main_mix_volume(new_volume);
|
|
}
|
|
|
|
int volume = a_conn.get_main_mix_volume();
|
|
printf("Volume: %d\n", volume);
|
|
return 0;
|
|
}
|