Advertisement
tabnation

detect sound ahk

May 29th, 2022 (edited)
999
1
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 1 0
  1. inputbox, triggervol, What do you want your trigger volumer? .0 something
  2.  
  3. #Include VA.ahk
  4. #SingleInstance, Force
  5. audioMeter := VA_GetAudioMeter()
  6. VA_IAudioMeterInformation_GetMeteringChannelCount(audioMeter, channelCount)
  7. VA_GetDevicePeriod("capture", devicePeriod)
  8. Return
  9.  
  10. f1::
  11. loop{
  12. VA_IAudioMeterInformation_GetPeakValue(audioMeter, peakValue)
  13. while (peakValue>triggervol)
  14. {
  15. click
  16. ;msgbox, I heard that
  17. Sleep, 3000
  18. VA_IAudioMeterInformation_GetPeakValue(audioMeter, peakValue)
  19. }
  20. Sleep, 3000
  21. }
  22.  
  23. f2:: ExitApp
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement