From 7f70a2c2f7fe1200751bda5d5a4c91716c04fe75 Mon Sep 17 00:00:00 2001 From: Andrea Alberti Date: Sun, 27 Oct 2024 16:31:54 +0100 Subject: [PATCH] - Fixed bug https://github.com/alberti42/Volume-Control/issues/27 --- Sources/Controllers/ISSoundAdditions.m | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Sources/Controllers/ISSoundAdditions.m b/Sources/Controllers/ISSoundAdditions.m index 4f2297f..e9094b3 100755 --- a/Sources/Controllers/ISSoundAdditions.m +++ b/Sources/Controllers/ISSoundAdditions.m @@ -129,7 +129,7 @@ + (void)setSystemVolume:(float)theVolume } //check if the new value is in the correct range - normalize it if not - newValue = theVolume > 1.0 ? 1.0 : (theVolume < 0.0 ? 0.0 : theVolume); + newValue = theVolume > 1.0 ? 1.0 : (theVolume <= 0.0 ? 0.0 : theVolume); if (newValue != theVolume) { NSLog(@"Tentative volume (%5.2f) was out of range; reset to %5.2f", theVolume, newValue); } @@ -138,7 +138,7 @@ + (void)setSystemVolume:(float)theVolume theAddress.mScope = kAudioDevicePropertyScopeOutput; //set the selector to mute or not by checking if under threshold and check if a mute command is available - if ( (muteValue = (newValue < THRESHOLD)) ) + if ( (muteValue = (newValue <= THRESHOLD)) ) { theAddress.mSelector = kAudioDevicePropertyMute; hasMute = AudioObjectHasProperty(defaultDevID, &theAddress);