mirror of
https://github.com/jetkvm/kvm.git
synced 2025-09-16 08:38:14 +00:00
- Move audio server logic to dedicated package and simplify main.go - Optimize buffer pool implementation and remove redundant logging - Improve process monitoring with synchronized metrics updates - Enhance microphone contention manager with simplified logic - Replace mutex with atomic operations for metrics tracking
23 lines
338 B
Go
23 lines
338 B
Go
package audio
|
|
|
|
import (
|
|
"sync"
|
|
)
|
|
|
|
var audioMuteState struct {
|
|
muted bool
|
|
mu sync.RWMutex
|
|
}
|
|
|
|
func SetAudioMuted(muted bool) {
|
|
audioMuteState.mu.Lock()
|
|
audioMuteState.muted = muted
|
|
audioMuteState.mu.Unlock()
|
|
}
|
|
|
|
func IsAudioMuted() bool {
|
|
audioMuteState.mu.RLock()
|
|
defer audioMuteState.mu.RUnlock()
|
|
return audioMuteState.muted
|
|
}
|