How can I mute/unmute my sound from PowerShell

后端 未结 10 2192
孤独总比滥情好
孤独总比滥情好 2020-11-29 06:14

Trying to write a PowerShell cmdlet that will mute the sound at start, unless already muted, and un-mute it at the end (only if it wasn\'t muted to begin with). Couldn\'t fi

10条回答
  •  既然无缘
    2020-11-29 06:29

    There does not seem to be a quick and easy way to adjust the volume.. If you have c++ experience, you could do something with this blog post, where Larry Osterman describes how to call the IAudioEndpointVolume interface from the platform api(for Vista, XP might be more difficult from what I've found in a few searches).

    V2 does allow you to compile inline code (via Add-Type), so that might be an option.

提交回复
热议问题