ich hab folgendes timingproblem ich lese die lautsctärke aus kann aber nicht setzen weil sie immer neu ausgelesen wird
wenn ich sleep einbaue verzögert sich die gui zusehr was nun?
Spoiler anzeigen
#Region Loop
While 1 ;* Sleep(20)
$volget = _SoundGetWaveVolume()
GUICtrlSetData($volume_slider2,$volget)
wend
Func _SoundGetWaveVolume()
Sleep(10)
Local $WaveVol = -1, $p, $ret
Const $MMSYSERR_NOERROR = 0
$p = DllStructCreate ("dword")
If @error Then
SetError(2)
Return -2
EndIf
$ret = DllCall("winmm.dll", "long", "waveOutGetVolume", "long", -1, "long", DllStructGetPtr ($p))
If ($ret[0] == $MMSYSERR_NOERROR) Then
$WaveVol = Round(Dec(StringRight(Hex(DllStructGetData ($p, 1), 8), 4)) / 0xFFFF * 100)
Else
SetError(1)
EndIf
$p=""
Return $WaveVol
EndFunc ;==>_SoundGetWaveVolume
#EndRegion Func's