Juno_okyo

_SoundGetWaveVolume UDF

Mar 30th, 2015
402
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
AutoIt 0.54 KB | None | 0 0
  1. Func _SoundGetWaveVolume()
  2.     Local $WaveVol = -1, $p, $ret
  3.     Const $MMSYSERR_NOERROR = 0
  4.     $p = DllStructCreate ("dword")
  5.     If @error Then
  6.         SetError(2)
  7.         Return -2
  8.     EndIf
  9.     $ret = DllCall("winmm.dll", "long", "waveOutGetVolume", "long", -1, "long", DllStructGetPtr ($p))
  10.     If ($ret[0] == $MMSYSERR_NOERROR) Then
  11.         $WaveVol = Round(Dec(StringRight(Hex(DllStructGetData ($p, 1), 8), 4)) / 0xFFFF * 100)
  12.     Else
  13.         SetError(1)
  14.     EndIf
  15.     $p = 0
  16.     Return $WaveVol
  17. EndFunc ;==>_SoundGetWaveVolume
Add Comment
Please, Sign In to add comment