SOUND PLAY

  • 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

    • Offizieller Beitrag

    Hi,

    vielleicht dir auch dies:

    [autoit]

    #include<Array.au3>
    SoundPlay("c:\Downloads\Musik\Hits\MP3CD_4\Rocky IV - Training Montage.mp3")

    [/autoit][autoit][/autoit][autoit]

    Do
    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("")

    [/autoit][autoit][/autoit][autoit]

    While 1
    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 = True

    [/autoit][autoit][/autoit][autoit]

    Local $aReturn[4] = [$aFile[2], $aMode[2], $aPos[2], $aLen[2]]

    If $iError Then SetError(1)
    Return $aReturn
    EndFunc ;==>_SoundGetInfo

    [/autoit]

    So long,

    Mega

  • cool danke!
    hatte ma wieda ein brett vorm kopf :hammer:
    das mit der UDF war genau das was ich gesucht habe!!!

    mfg

    DjBasslord

    Einmal editiert, zuletzt von DjBasslord (28. Januar 2007 um 21:36)