Hallo zusammn!
Ich hab da ma ne fragE:
ich möchte gerne wissn wie ich herausfindn kann ob soundplay schon beendet ist! Will das nämlich in nen loop tun!
kann mir bitte jd helfn?
mfg
DjBasslord
SOUND PLAY
-
- [ offen ]
-
DjBasslord -
26. Januar 2007 um 20:06 -
Geschlossen -
Erledigt
-
-
- Offizieller Beitrag
Hi,
du kannst den Parameter nutzen um das Skript so lange anzuhalten, bis der SOUND zuende ist.
So long,
Mega
-
- Offizieller Beitrag
Hi,
vielleicht dir auch dies:
[autoit]#include<Array.au3>
[/autoit][autoit][/autoit][autoit]
SoundPlay("c:\Downloads\Musik\Hits\MP3CD_4\Rocky IV - Training Montage.mp3")Do
[/autoit][autoit][/autoit][autoit]
Sleep(25)
$a = _SoundGetInfo()
$stand = StringFormat("%.02d" & ":" & "%.02d", Mod(Round($a[2] / 1000, 0) / 60, 60), Mod(Round($a[2] / 1000, 0), 60))
$ende = StringFormat("%.02d" & ":" & "%.02d", Mod(Round($a[3] / 1000, 0) / 60, 60), Mod(Round($a[3] / 1000, 0), 60))
ToolTip($a[1] & @CRLF & $stand & " von " & $ende , Default, Default, $a[0], 1)
Until $stand = $ende
Sleep(1000)
ToolTip("")While 1
[/autoit][autoit][/autoit][autoit]
Sleep(100)
WEnd;===============================================================================
[/autoit][autoit][/autoit][autoit]
;
; Function Name: _SoundGetInfo()
; Description: Returns information on the file opened file by SoundPlay() or _SoundOpen().
;
; Return Value(s): On Success - Returns a four-element array :
; $array[0] - file
; $array[1] - mode (can be : "not ready/stopped/playing/paused")
; $array[2] - position in msec.
; $array[3] - length in msec.
;
; On Failure - Returns a four-element array and sets @error to 1.
;
; Author(s): Helge
;
;===============================================================================
Func _SoundGetInfo()
Local $iError, $aFile, $aMode, $aPos, $aLen
$aFile = DllCall("winmm.dll", "int", "mciSendString", "str", _
"info playMe file", "str", "", "int", 65534, "hwnd", 0)
If @error Or $aFile[2] = "" Then $iError = True
$aMode = DllCall("winmm.dll", "int", "mciSendString", "str", _
"status playMe mode", "str", "", "int", 65534, "hwnd", 0)
If @error Or $aMode[2] = "" Then $iError = True
$aPos = DllCall("winmm.dll", "int", "mciSendString", "str", _
"status playMe position", "str", "", "int", 65534, "hwnd", 0)
If @error Or $aPos[2] = "" Then $iError = True
$aLen = DllCall("winmm.dll", "int", "mciSendString", "str", _
"status playMe length", "str", "", "int", 65534, "hwnd", 0)
If @error Or $aLen[2] = "" Then $iError = TrueLocal $aReturn[4] = [$aFile[2], $aMode[2], $aPos[2], $aLen[2]]
[/autoit]
If $iError Then SetError(1)
Return $aReturn
EndFunc ;==>_SoundGetInfoSo long,
Mega
-
- Offizieller Beitrag
Hallo!
Es gibt schon in dem "neuen" autoit (3.2.2.0) ein sound UDF! siehe in der hilfe einfach mal unter "_SoundPlay"
Mfg Spider
-
cool danke!
hatte ma wieda ein brett vorm kopf :hammer:
das mit der UDF war genau das was ich gesucht habe!!!mfg
DjBasslord