Skip to content

Commit

Permalink
Merge pull request #121 from t3knomanzer/fix-endpointvolume-null
Browse files Browse the repository at this point in the history
Adding exception handling to endpointvolume access
  • Loading branch information
t3knomanzer authored Aug 8, 2020
2 parents 7928e39 + 9f4600b commit 4e46cb8
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Desktop/Application/MaxMix/Services/Audio/AudioDevice.cs
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,8 @@ public int Volume

_isNotifyEnabled = false;
_volume = value;
_endpointVolume.MasterVolumeLevelScalar = value / 100f;
try { _endpointVolume.MasterVolumeLevelScalar = value / 100f; }
catch { }
}
}

Expand All @@ -101,7 +102,8 @@ public bool IsMuted

_isNotifyEnabled = false;
_isMuted = value;
_endpointVolume.IsMuted = value;
try { _endpointVolume.IsMuted = value; }
catch { }
}
}
#endregion
Expand Down

0 comments on commit 4e46cb8

Please sign in to comment.