AppleScript的:检查电脑在播放任何声音 [英] Applescript: Check if computer is playing any sound
问题描述
试图找到我的脚本,以检查是否有任何声音/音频当前播放的计算机上的一种方式。如果是这样,有没有办法找出哪些应用正在播放的声音?
Trying to find a way for my script to check if there's any sound/audio being played currently on the computer. And if so, is there any way to find which app is playing sound?
推荐答案
也许这可以帮助:
在播放声音出现这种情况的一件事是,电源管理模块的电脑去睡觉。随着 pmset -g
你可以看到所有正在发生的电源管理的东西。
One thing that happens when a sound is played is that the power management blocks the computer to go to sleep. With pmset -g
you can see all the Power Management stuff that is going on.
所以,睡觉的时候通过coreaudiodpvented机器打显然有些声音。$ P $
So, when sleep is prevented by "coreaudiod" the machine is playing obviously some sound.
下面是什么 pmset -g
吐出来时的iTunes播放:
Here what pmset -g
spits out when iTunes is playing:
Currently in use:
womp 0
halfdim 1
sms 1
hibernatefile /var/vm/sleepimage
gpuswitch 2
networkoversleep 0
disksleep 10
sleep 10 (sleep prevented by iTunes, coreaudiod)
hibernatemode 3
ttyskeepawake 1
displaysleep 10
acwake 0
lidwake 1
结果
这篇关于AppleScript的:检查电脑在播放任何声音的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!