why doesn't MM register with Windows Core audio API?

To discuss development of addons / skins / customization of MediaMonkey v5 / v2024

Moderators: jiri, drakinite, Addon Administrators

AudioBabble
Posts: 25
Joined: Mon May 09, 2022 3:08 pm

why doesn't MM register with Windows Core audio API?

Post by AudioBabble »

Hello,

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's an AHK script... I'm hoping to make a script that keep the screen from entering sleep during playback [maybe there's an easier way?]

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.).
AudioBabble
Posts: 25
Joined: Mon May 09, 2022 3:08 pm

Re: why doesn't MM register with Windows Core audio API?

Post by AudioBabble »

bloody typical... just after posting this... it works!

nothing to see here!!
Post Reply