Advertisement
Guest User

Untitled

a guest
Nov 6th, 2016
171
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.95 KB | None | 0 0
  1. #NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
  2. ; #Warn ; Enable warnings to assist with detecting common errors.
  3. SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
  4. SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
  5.  
  6. StreamingSoundDevice := "CABLE Input"
  7. NonStreamingSoundDevice := "Speakers"
  8. CurrentSoundDevice := NonStreamingSoundDevice
  9. PreviousSoundDevice := ""
  10.  
  11. Loop
  12. {
  13. If ProcessExist("steam_monitor.exe") {
  14. CurrentSoundDevice := StreamingSoundDevice
  15. }
  16.  
  17.  
  18. If !ProcessExist("steam_monitor.exe") {
  19. CurrentSoundDevice := NonStreamingSoundDevice
  20. }
  21.  
  22. if (CurrentSoundDevice != PreviousSoundDevice) {
  23. PreviousSoundDevice := CurrentSoundDevice
  24. Run nircmd setdefaultsounddevice "%CurrentSoundDevice%"
  25. }
  26.  
  27. Sleep, 1000
  28. }
  29.  
  30. ProcessExist(Name){
  31. Process,Exist,%Name%
  32. return Errorlevel
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement