Add constant volume output setting#125
Conversation
Greptile SummaryThis PR adds a "Constant volume" setting that compensates Thock's playback gain against the current macOS system output volume, keeping keyboard sounds at a consistent perceived level when the user adjusts system volume. It reads output volume via CoreAudio (preferring dB, falling back to
Confidence Score: 3/5The core settings plumbing and UI are solid, but the volume-reading logic in AudioDeviceManager has a fallback path that can silently return a per-channel (not master) volume value, making the compensation wrong on affected devices. The maximumGain ceiling is also set high enough to cause PCM clipping at moderate-low system volumes. The per-channel dB fallback in getOutputDecibelVolume returns channel 1's reading instead of the master volume when the main channel lacks dB support — on a device where the user has adjusted audio balance, this feeds a wrong divisor into currentRenderVolume(), producing incorrect gain compensation. Separately, the 100× maximumGain cap allows the compensated scalar to climb well into the clipping zone for typical normalized PCM data at moderate-low system volumes (~20–30%), defeating the feature's goal of clean constant-level output. Both issues are in the two most central new files. AudioDeviceManager.swift (volume-reading priority and per-channel fallback) and SoundManager.swift (maximumGain ceiling and lockless-read scope). Important Files Changed
Reviews (1): Last reviewed commit: "Add constant volume output setting" | Re-trigger Greptile |
|
thanks! ill do the cr tomorrow |
Fixes #74