_Soundplay Problem

  • Hallo
    ich habe hier ein Problem

    Spoiler anzeigen
    [autoit]

    #include <File.au3>
    #include <Sound.au3>
    Opt('MustDeclareVars', 1)
    Global $open, $file, $sound
    $file = _FileListToArray (@ScriptDir & "\Musik")
    SoundSetWaveVolume (100)
    For $a = 1 to $file[0]
    $open = _SoundOpen (@ScriptDir & "\Musik\" & $file[1],"Startup")
    $sound = _SoundPlay ($open,1)
    ;$sound = SoundPlay ("Musik\" & $file[1])
    While 1
    ToolTip ($sound & @CRLF & _SoundStatus ($sound),0,0)
    If _SoundStatus ($sound) = 2 Then ExitLoop 2
    WEnd
    Next
    MsgBox (0,"","")

    [/autoit]

    Mein Problem ist das kein stück tohn rauskommt :( aber mit soundplay gehts ohne probleme nur dieses kack _soaundplay geht nicht
    bitte hilfe

    OK habs jetz
    das problem lag an ASCII

    Einmal editiert, zuletzt von Freaky (14. August 2009 um 17:26)

  • [autoit]

    _SoundOpen(@ScriptDir & "\Musik" & $file[1])

    [/autoit]


    So sollte das eig aussehen.

    EDIT: Sry, nicht richtig gelesen.

  • So:?

    [autoit]


    #include <File.au3>
    #include <Sound.au3>
    Opt('MustDeclareVars', 1)
    Global $open, $file, $sound
    $file = _FileListToArray (@ScriptDir & "\Musik")
    SoundSetWaveVolume (100)
    For $a = 1 to $file[0]
    $open = _SoundOpen (@ScriptDir & "\Musik\" & $file[$a])
    _SoundPlay ($open,0);da er bei 1 wartet brauchst du die Schleife nicht, sonst Parameter = 0 (siehe Hilfe)
    ;$sound = SoundPlay ("Musik\" & $file[1])
    While 1
    ToolTip ($open & @CRLF & _SoundStatus ($open),0,0) ;_Soundplay gibt nur bei Erfolg 1 zurück
    If _SoundStatus ($open) = 2 Then ExitLoop
    WEnd
    _soundclose($open)
    Next
    MsgBox (0,"","")

    [/autoit]

    (um das mal für den der helfen wollte zu zeigen)