I found this bit of code on reddit:
Code: Select all
#Requires AutoHotkey v2.0
SetTimer CheckAudioChange, 500 ; every 500 ms, SetTimer checks if audio is started or stopped.
OnAudioChange(isPlaying) { ; this function is called by CheckAudioChange when it detects sound start/stop.
if isPlaying {
MsgBox "audio playing"
} else {
MsgBox "audio stopped"
}
}
CheckAudioChange() {
static audioMeter := ComValue(13, SoundGetInterface("{C02216F6-8C67-4B5B-9D00-D008E73E0064}")), peak := 0, playing := 0
if audioMeter {
ComCall 3, audioMeter, "float*", &peak
if peak > 0.0001 {
if playing = 1
return
playing := 1
OnAudioChange(1)
} else {
if playing = 0
return
playing := 0
OnAudioChange(0)
}
}
}
It LOOKS like it might do what I'm hoping... and it does -- with browser audio and also Windows Media player.
Why doesn't it work with MM5? (I'm running a portable install, if that makes any odds.).