mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 12:12:45 +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:
		
							parent
							
								
									2b9ec22576
								
							
						
					
					
						commit
						107011f119
					
				
					 8 changed files with 72 additions and 15 deletions
				
			
		|  | @ -32,6 +32,16 @@ bool AClientConnection::try_enqueue(const ABuffer& buffer) | |||
|     return response->success(); | ||||
| } | ||||
| 
 | ||||
| bool AClientConnection::get_muted() | ||||
| { | ||||
|     return send_sync<AudioServer::GetMuted>()->muted(); | ||||
| } | ||||
| 
 | ||||
| void AClientConnection::set_muted(bool muted) | ||||
| { | ||||
|     send_sync<AudioServer::SetMuted>(muted); | ||||
| } | ||||
| 
 | ||||
| int AClientConnection::get_main_mix_volume() | ||||
| { | ||||
|     return send_sync<AudioServer::GetMainMixVolume>()->volume(); | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Andreas Kling
						Andreas Kling