frgnca / AudioDeviceCmdlets

AudioDeviceCmdlets is a suite of PowerShell Cmdlets to control audio devices on Windows
MIT License
743 stars 92 forks source link

Mute state #10

Closed cgrace70 closed 7 years ago

cgrace70 commented 8 years ago

Is there a way to determine the state of mute/unmute for the default audio device? I know you can set it, but I want to determine if it is muted or not.

cdhunt commented 8 years ago

Not currently.

cdhunt commented 8 years ago

@cgrace70 It's not obvious, but you can get and set mute state manually.

(Get-DefaultAudioDevice).Device.AudioEndpointVolume.Mute

(Get-DefaultAudioDevice).Device.AudioEndpointVolume.Mute = $true
cgrace70 commented 8 years ago

Perfect! Thank you.

frgnca commented 7 years ago

I have created pull request #13 (Get-DefaultAudioDeviceMute) which should resolve this enhancement request. It returns a value of true or false.

cdhunt commented 7 years ago

Closing thanks to @frgnca contribution.