Hallo,
ich möchte einen Sound so lange abspielen, bis die Messagebox gedrückt wurde und fand folgenden Code:
Sound so lange abspielen bis MSGBox bestätigt
Post 11
Das funktioniert hier leider nicht - in Zeile 7 wird der Sound nicht gestoppt.
Wie muss der Code geändert werden?
Ich möchte diesen Code gerne lauffähig gestalten.
Global Const $SND_ASYNC = 0x01
Global Const $SND_LOOP = 0x08
PlaySound ("Windows Exclamation.wav", 0, BitOR($SND_LOOP, $SND_ASYNC))
MsgBox (64, "Sound stoppen", "Sound stoppen")
PlaySound ("", 0, 0)
MsgBox (64, "Sound stoppen", "Sound sollte jetzt aus sein - läuft aber weiter.")
Func PlaySound ($pszSound, $hmod, $fdwSound)
Local $ret = DllCall ("Winmm.dll", "BOOL", "PlaySoundW", "wstr", $pszSound, "HANDLE", $hmod, "DWORD", $fdwSound)
Return $ret[0]
EndFunc
Alles anzeigen
Danke
PS:
Eine Alternative wäre
#include <Sound.au3>
_SoundPlay($aSnd_id [, $iWait])
Ließe sich einfacher damit eine einfache Endlosschleife mit einer wav Datei erstellen?
Wichtig - die verwendeten Wav Dateien sind unterschiedlich lang - mal wenige Sekunden, mal eine Stunde.
Daher müssen die kurzen in einer Schleife wiedergegeben werden bzw. die langen unterbrochen werden.
Obiges Script sieht interessant aus - leider stoppt es hier nicht.