有没有办法通过 PowerShell 检测声音? [英] Is there a way to detect sound via PowerShell?
问题描述
我想检测 PC 是否正在播放任何类型的声音.
I want to detect if PC is playing any kind of sound.
如果它没有播放任何类型的声音,我可以在 Powershell 中使用 else 条件,然后做我接下来需要做的任何事情.
if it isn't playing any kind of sound I can use else condition in Powershell and do whatever I need to do next.
那么有没有办法通过 PowerShell 检测声音?
So is there anyway to detect sound via PowerShell?
谢谢
推荐答案
方法 1...
Import-Module -Name TroubleShootingPack
Get-TroubleshootingPack C:\Windows\diagnostics\system\Audio | Invoke-TroubleshootingPack
方法二...开始对 C:\Windows\diagnostics\system\Audio 中的脚本进行逆向工程:)
method 2... start to reverse engineer the scripts in C:\Windows\diagnostics\system\Audio :)
P.S:您还可以阅读 shay 的博客,了解如何完成您的特定任务http://scriptolog.blogspot.co.il/2007/09/playing-sounds-in-powershell.html
P.S: You can also read in shay's blog about how to do your specific task http://scriptolog.blogspot.co.il/2007/09/playing-sounds-in-powershell.html
这篇关于有没有办法通过 PowerShell 检测声音?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!