1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 23:28:11 +00:00

AudioServer: Allow muting the system audio

This patch adds muting to ASMixer, which works by substituting what we
would normally send to the sound card with zero-filled memory instead.
We do it this way to ensure that the queued sample buffers keep getting
played (silently.)

This is obviously not the perfect way of doing this, and in the future
we should improve on this, and also find a way to utilize any hardware
mixing functions in the sound card.
This commit is contained in:
Andreas Kling 2019-11-22 21:44:02 +01:00
parent 2b9ec22576
commit 107011f119
8 changed files with 72 additions and 15 deletions

View file

@ -27,6 +27,8 @@ private:
virtual OwnPtr<AudioServer::SetPausedResponse> handle(const AudioServer::SetPaused&) override;
virtual OwnPtr<AudioServer::ClearBufferResponse> handle(const AudioServer::ClearBuffer&) override;
virtual OwnPtr<AudioServer::GetPlayingBufferResponse> handle(const AudioServer::GetPlayingBuffer&) override;
virtual OwnPtr<AudioServer::GetMutedResponse> handle(const AudioServer::GetMuted&) override;
virtual OwnPtr<AudioServer::SetMutedResponse> handle(const AudioServer::SetMuted&) override;
ASMixer& m_mixer;
RefPtr<ASBufferQueue> m_queue;