Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
- ; #Warn ; Enable warnings to assist with detecting common errors.
- SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
- SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
- StreamingSoundDevice := "CABLE Input"
- NonStreamingSoundDevice := "Speakers"
- CurrentSoundDevice := NonStreamingSoundDevice
- PreviousSoundDevice := ""
- Loop
- {
- If ProcessExist("steam_monitor.exe") {
- CurrentSoundDevice := StreamingSoundDevice
- }
- If !ProcessExist("steam_monitor.exe") {
- CurrentSoundDevice := NonStreamingSoundDevice
- }
- if (CurrentSoundDevice != PreviousSoundDevice) {
- PreviousSoundDevice := CurrentSoundDevice
- Run nircmd setdefaultsounddevice "%CurrentSoundDevice%"
- }
- Sleep, 1000
- }
- ProcessExist(Name){
- Process,Exist,%Name%
- return Errorlevel
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement