2

I would like to turn off the sound (windows 10) when the monitor turns off. I currently have power settings to turn off the monitor after 15 minutes. I would like the sound to turn off then too.

I'm not sure there's a built-in windows way of doing this, but if there's and external tool to do so, that would help too.

Edit: Addressing the potential dupe-- nircmd alone doesn't give a solution. It's only one method of turning off sound if I can find a way to trigger it after 15 minutes of inaction, and trigger it to turn back on upon some action, like with the monitor power settings. Task scheduler does not appear to have a trigger that can act as a timer in this way.

3
  • Possible duplicate of Mute sound after a certain time for Windows? Commented Aug 16, 2019 at 0:49
  • The proposed duplicate is only part of the answer. It doesn't address how to trigger this when the monitor turns off. Commented Aug 16, 2019 at 1:27
  • @ wrecclesham nircmd might be part of a solution, but this doesn't really tell how it could be used to turn off sound after 15 minutes of inaction, like the monitor (nor how to turn them back on) I don't see any trigger like that in windows task scheduler
    – Odj fourth
    Commented Aug 16, 2019 at 15:33

3 Answers 3

0

Okay, so it was a particular noise-making application I wanted to stop when the system went idle (and monitor turned off) but didn't want the system to sleep. I realized I didn't care if the application was killed, so I just wrote a one-liner script to kill it, and set it for the idle trigger in task scheduler. No need to kill the volume in particular, or figure out how to detect a return from idle and reinstate the volume.

Oddly, taskkill /im wouldn't work, so I had to use the following:

wmic process where name="application.exe" call terminate
0

Open Control Panel and look for Sound (or just click start and search for "Change system sounds"), under the "Sound" tab, look for Device Connect and Device Disconnect in the Program Events list, and from the drop down menu below select "(None)".

Note that doing so will also stop Windows from making a sound when you plug or unplug any hardware like USB, mouse etc.

1
  • 1
    I think you misunderstood the question. It's not about the sound effect of monitor standby, but about muting all programs when monitor goes dark. Commented Dec 18, 2020 at 8:53
0

I think it can be relatively easily done with Autohotkey.

With task scheduler, add task with Program: C:\path\to\autohotkey.exe Parameters: "C:\...path\to\script.ahk" to run on idle under your account (only when user is logged in, uncheck [ ] Stop if computer ceases to be idle, the script will unmute and exit on its own):

script.ahk:

#NoEnv

SoundGet manually_muted,,MUTE
If (manually_muted = "Off") {
    currently_idle := A_TimeIdle
    SoundSet 1,,MUTE
    Loop
    {
        Sleep 1000
    } Until (A_TimeIdle < currently_idle)
    SoundSet 0,,MUTE
}
ExitApp

Without task scheduler, use following script (just run it, it will stay resident using about 4 MB of RAM):

#NoEnv
#NoTrayIcon
#Persistent
#SingleInstance force

TimeIdleToMute_ms := 15 * 60 * 1000 ; timeout in milliseconds

SetTimer MuteUntilIdleEnds, % TimeIdleToMute_ms

Exit

MuteUntilIdleEnds() {
    global TimeIdleToMute_ms
    static idlemuted := 0
    
    If (!idlemuted && A_TimeIdle > TimeIdleToMute_ms) {
        SoundGet manually_muted,,MUTE
        If (manually_muted = "Off") {
            idlemuted := A_TimeIdle
            SoundSet 1,,MUTE
            Loop
            {
                Sleep 1000 ; ms
            } Until (A_TimeIdle < idlemuted)
            SoundSet 0,,MUTE
            idlemuted := 0
        }
    }
}

Both scripts might be rewritten to react to Windows messages instead of idle-looping, but even now resource consumption is negligible.

Second script, when running without administrator privileges, might have trouble detecting activity of apps running with administrator privileges (it will mute after timeout when they are focused despite user has activity with them). However if you'll occasionally switch focus to non-admin programs until the timeout hits, it will suffice to reset the timer. Also, switching to non-admin program will end the mute, since script will detect activity.

Both scripts are written and quickly tested for the answer, there might be bugs, report and beware :)

P. S. SE, where the syntax highlighting!?

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .