With the volume at zero, my MacBook's speakers were still playing. Quietly enough that you only notice in a quiet room, but they were playing.
Zero is a position, not silence
On a Mac, volume and mute are two separate things. Volume is a number between 0 and 1. Mute is a switch. CoreAudio keeps them as two properties on the output device, and nothing forces them to agree.
The number is a position on the device's range, and the device reports that range in decibels. So I asked the built-in speakers for theirs:
var range = AudioValueRange ( ) var size = UInt32 ( MemoryLayout < AudioValueRange > . size ) var a = AudioObjectPropertyAddress ( mSelector : kAudioDevicePropertyVolumeRangeDecibels , mScope : kAudioDevicePropertyScopeOutput , mElement : kAudioObjectPropertyElementMain ) AudioObjectGetPropertyData ( device , & a , 0 , nil , & size , & range ) print ( range . mMinimum , range . mMaximum ) // -63.5 0.0
Enter fullscreen mode
Exit fullscreen mode
The bottom of the range is β63.5 dB.β¦