| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566 |
- #include "soundDetect.au3"
- Local $ui = GUICreate('Level', 30, 150, 100,100, Default, 0x00000008)
- Local $ProgressBar = GUICtrlCreateProgress(10, 10, 10, 115, 0x04)
- GUISetState(@SW_HIDE, $ui)
- HotKeySet("{F5}","terminate")
- Local $showPeakLevel = true
- Local $appDotExe = "Wow.exe"
- Local $debug = true
- ;================================================
- while 1
- if ($debug == true) then debugMode()
- if ($showPeakLevel == true) then
- GUISetState(@SW_SHOW, $ui)
- Local $peakLevel = getApplicationPeakLevel($appDotExe)
- If ($peakLevel > 78) and ($debug == true) Then MsgBox(64, 'Its over 99', 'Too Loud. Neighbours will be angry')
- GUICtrlSetData($ProgressBar, $peakLevel)
- ConsoleWrite($peakLevel & " - " & $appDotExe & @crlf)
- EndIf
- ;Sleep(100)
- WEnd
- ;================================================
- Func getApplicationPeakLevel($appDotExe)
- $aApp = _GetAppsPlayingSound()
- If (UBound($aApp)>1) then
- For $i= 0 to UBound($aApp)-1
- If ($aApp[$i][0] == $appDotExe) then
- return Int($aApp[$i][1]*100)
- EndIf
- Next
- EndIf
- return 0
- EndFunc
- Func debugMode()
- Local $str = ""
- $aApp = _GetAppsPlayingSound()
- If (UBound($aApp)>1) then
- For $i= 0 to UBound($aApp)-1
- $str = $str & Int($aApp[$i][1]*100) & " - " & $aApp[$i][0] & @CRLF
- Next
- ToolTip($str, 1, 1)
- EndIf
- return 0
- EndFunc
- Func terminate()
- GUIDelete($ui)
- Exit
- EndFunc
|