Hallo Leute,
wie kann man ein lied abspielen das endlos läuft, dh. sobald GUI sich startet das lied abspielen und wenn es fertig ist soll es von neu anfangen.
Lg
Hallo Leute,
wie kann man ein lied abspielen das endlos läuft, dh. sobald GUI sich startet das lied abspielen und wenn es fertig ist soll es von neu anfangen.
Lg
Hallo DeathNote,
das kannst du so machen:
[autoit]#include <Sound.au3>
[/autoit][autoit][/autoit][autoit]$gui = GUICreate("TestGUI")
GUISetState()
;open sound file : must be modified
$sound = _SoundOpen("C:\DownLoader\Broilers\Broilers - Tanzt du noch einmal mit mir (Studio Version) [HD].MP3")
If @error = 2 Then
MsgBox(0, "Error", "The file does not exist")
Exit
ElseIf @extended <> 0 Then
$extended = @extended ;assign because @extended will be set after DllCall
$stText = DllStructCreate("char[128]")
$errorstring = DllCall("winmm.dll", "short", "mciGetErrorStringA", "str", $extended, "ptr", DllStructGetPtr($stText), "int", 128)
MsgBox(0, "Error", "The open failed." & @CRLF & "Error Number: " & $extended & @CRLF & "Error Description: " & DllStructGetData($stText, 1) & @CRLF & "Please Note: The sound may still play correctly.")
Else
$iLength = _SoundLength($sound,2)
EndIf
_SoundPlay($sound)
AdlibRegister("_checkReplay")
[/autoit][autoit][/autoit][autoit]While 1
$iMsg = GUIGetMsg()
Switch $iMsg
Case $GUI_EVENT_CLOSE
_SoundClose($sound)
Exit
EndSwitch
WEnd
Func _checkReplay()
if _SoundPos($sound,2) >= $iLength Then _SoundPlay($sound, 1)
EndFunc
_SoundClose($sound)
[/autoit]Edit: Skript nach Test noch einmal geändert
mfg autoBert
Hallo Leute,
wie kann man ein lied abspielen das endlos läuft, dh. sobald GUI sich startet das lied abspielen und wenn es fertig ist soll es von neu anfangen.
Lg
Definiere Lied mal näher: mp3, wav, xm, mod, mid, aac, ogg, etc.
Gruß,
UEZ