Brauch mal wieder Hilfe... ^^ Mp3 Wiedergabe

  • sooo der nervende wieder :D alsooo habe mein player soweit mit den menüs und so fertig.. jetzt hab ich als grundgui den radiostream und 2 zusatzbutton wo ich video und mp3 wiedergabe betreiben möchte ^^ jetzt aber erstmal zu mp3 wiedergabe.. kann mir da vielleicht jemand helfen? man klicke in mein script auf mp3 und da möchte ich das man auf load klickt und man dann einzelt mp3s laden und abspielen kann..wäre natürlich auch suppie wenn man mir auch gleich den play pause und stop buttons mit einbindet.. *tüdelüü* ich weiß ich verlang immer viel von euch :) aber wenn es einmal so da steht wie es richtig funzt geht das auch bei mir in kopf rein :) hier mein script :P


    Spoiler anzeigen

    #include <GUIConstants.au3>
    #include <WindowsConstants.au3>

    $main = GUICreate("Extrem Stream 2.0", 680, 380, -1, -1, -1, $WS_EX_COMPOSITED) ;double buffering der GUI -> nur XP!
    GUISetBkColor(0x00000000)
    $start = GUICtrlCreateButton("Play", 10, 30, 95)
    GUICtrlSetFont(-1, 9, 400, 0, "Comic Sans MS")
    GUICtrlSetBkColor(-1, 0x00FF0000)
    $stop = GUICtrlCreateButton("Stop", 110, 30, 95)
    GUICtrlSetFont(-1, 9, 400, 0, "Comic Sans MS")
    GUICtrlSetBkColor(-1, 0x00FF0000)
    $start2 = GUICtrlCreateButton("Play", 10, 100, 95)
    GUICtrlSetFont(-1, 9, 400, 0, "Comic Sans MS")
    GUICtrlSetBkColor(-1, 0x00FF0000)
    $stop2 = GUICtrlCreateButton("Stop", 110, 100, 95)
    GUICtrlSetFont(-1, 9, 400, 0, "Comic Sans MS")
    GUICtrlSetBkColor(-1, 0x00FF0000)
    $start3 = GUICtrlCreateButton("Play", 10, 165, 95)
    GUICtrlSetFont(-1, 9, 400, 0, "Comic Sans MS")
    GUICtrlSetBkColor(-1, 0x00FF0000)
    $stop3 = GUICtrlCreateButton("Stop", 110, 165, 95)
    GUICtrlSetFont(-1, 9, 400, 0, "Comic Sans MS")
    GUICtrlSetBkColor(-1, 0x00FF0000)
    $start4 = GUICtrlCreateButton("Play", 10, 225, 95)
    GUICtrlSetFont(-1, 9, 400, 0, "Comic Sans MS")
    GUICtrlSetBkColor(-1, 0x00FF0000)
    $stop4 = GUICtrlCreateButton("Stop", 110, 225, 95)
    GUICtrlSetFont(-1, 9, 400, 0, "Comic Sans MS")
    GUICtrlSetBkColor(-1, 0x00FF0000)
    $start5 = GUICtrlCreateButton("Play", 10, 295, 95)
    GUICtrlSetFont(-1, 9, 400, 0, "Comic Sans MS")
    GUICtrlSetBkColor(-1, 0x00FF0000)
    $stop5 = GUICtrlCreateButton("Stop", 110, 295, 95)
    GUICtrlSetFont(-1, 9, 400, 0, "Comic Sans MS")
    GUICtrlSetBkColor(-1, 0x00FF0000)
    $start6 = GUICtrlCreateButton("Play", 230, 30, 95)
    GUICtrlSetFont(-1, 9, 400, 0, "Comic Sans MS")
    GUICtrlSetBkColor(-1, 0x00FF0000)
    $stop6 = GUICtrlCreateButton("Stop", 330, 30, 95)
    GUICtrlSetFont(-1, 9, 400, 0, "Comic Sans MS")
    GUICtrlSetBkColor(-1, 0x00FF0000)
    $start7 = GUICtrlCreateButton("Play", 230, 100, 95)
    GUICtrlSetFont(-1, 9, 400, 0, "Comic Sans MS")
    GUICtrlSetBkColor(-1, 0x00FF0000)
    $stop7 = GUICtrlCreateButton("Stop", 330, 100, 95)
    GUICtrlSetFont(-1, 9, 400, 0, "Comic Sans MS")
    GUICtrlSetBkColor(-1, 0x00FF0000)
    $start8 = GUICtrlCreateButton("Play", 230, 165, 95)
    GUICtrlSetFont(-1, 9, 400, 0, "Comic Sans MS")
    GUICtrlSetBkColor(-1, 0x00FF0000)
    $stop8 = GUICtrlCreateButton("Stop", 330, 165, 95)
    GUICtrlSetFont(-1, 9, 400, 0, "Comic Sans MS")
    GUICtrlSetBkColor(-1, 0x00FF0000)
    $start9 = GUICtrlCreateButton("Play", 230, 225, 95)
    GUICtrlSetFont(-1, 9, 400, 0, "Comic Sans MS")
    GUICtrlSetBkColor(-1, 0x00FF0000)
    $stop9 = GUICtrlCreateButton("Stop", 330, 225, 95)
    GUICtrlSetFont(-1, 9, 400, 0, "Comic Sans MS")
    GUICtrlSetBkColor(-1, 0x00FF0000)
    $start10 = GUICtrlCreateButton("Play", 230, 295, 95)
    GUICtrlSetFont(-1, 9, 400, 0, "Comic Sans MS")
    GUICtrlSetBkColor(-1, 0x00FF0000)
    $stop10 = GUICtrlCreateButton("Stop", 330, 295, 95)
    GUICtrlSetFont(-1, 9, 400, 0, "Comic Sans MS")
    GUICtrlSetBkColor(-1, 0x00FF0000)
    $start11 = GUICtrlCreateButton("Play", 467, 30, 95)
    GUICtrlSetFont(-1, 9, 400, 0, "Comic Sans MS")
    GUICtrlSetBkColor(-1, 0x00FF0000)
    $stop11 = GUICtrlCreateButton("Stop", 567, 30, 95)
    GUICtrlSetFont(-1, 9, 400, 0, "Comic Sans MS")
    GUICtrlSetBkColor(-1, 0x00FF0000)
    $start12 = GUICtrlCreateButton("Play", 467, 100, 95)
    GUICtrlSetFont(-1, 9, 400, 0, "Comic Sans MS")
    GUICtrlSetBkColor(-1, 0x00FF0000)
    $stop12 = GUICtrlCreateButton("Stop", 567, 100, 95)
    GUICtrlSetFont(-1, 9, 400, 0, "Comic Sans MS")
    GUICtrlSetBkColor(-1, 0x00FF0000)
    $start13 = GUICtrlCreateButton("Play", 467, 165, 95)
    GUICtrlSetFont(-1, 9, 400, 0, "Comic Sans MS")
    GUICtrlSetBkColor(-1, 0x00FF0000)
    $stop13 = GUICtrlCreateButton("Stop", 567, 165, 95)
    GUICtrlSetFont(-1, 9, 400, 0, "Comic Sans MS")
    GUICtrlSetBkColor(-1, 0x00FF0000)
    $start14 = GUICtrlCreateButton("Play", 467, 225, 95)
    GUICtrlSetFont(-1, 9, 400, 0, "Comic Sans MS")
    GUICtrlSetBkColor(-1, 0x00FF0000)
    $stop14 = GUICtrlCreateButton("Stop", 567, 225, 95)
    GUICtrlSetFont(-1, 9, 400, 0, "Comic Sans MS")
    GUICtrlSetBkColor(-1, 0x00FF0000)
    $start15 = GUICtrlCreateButton("Play", 467, 295, 95)
    GUICtrlSetFont(-1, 9, 400, 0, "Comic Sans MS")
    GUICtrlSetBkColor(-1, 0x00FF0000)
    $stop15 = GUICtrlCreateButton("Stop", 567, 295, 95)
    GUICtrlSetFont(-1, 9, 400, 0, "Comic Sans MS")
    GUICtrlSetBkColor(-1, 0x00ff0000)


    GUICtrlSetFont(-1, 9, 400, 0, "Comic Sans MS")
    GUICtrlSetBkColor(-1, 0x00FF0000)
    GUICtrlCreateButton("Hardstyle", 25, 2, 165)
    GUICtrlCreateButton("Heavy Metal/Rock", 25, 65, 165)
    GUICtrlCreateButton("Rnb/Black", 25, 132, 165)
    GUICtrlCreateButton("Chill Out", 25, 195, 165)
    GUICtrlCreateButton("Charts", 25, 260, 165)
    GUICtrlCreateButton("Trance", 250, 2, 165)
    GUICtrlCreateButton("Techno", 250, 65, 165)
    GUICtrlCreateButton("Hip Hop", 250, 132, 165)
    GUICtrlCreateButton("Jazz", 250, 195, 165)
    GUICtrlCreateButton("Schlager", 250, 260, 165)
    GUICtrlCreateButton("Dance", 480, 2, 165)
    GUICtrlCreateButton("Jumpstyle", 480, 65, 165)
    GUICtrlCreateButton("Salsa", 480, 132, 165)
    GUICtrlCreateButton("House", 480, 195, 165)
    GUICtrlCreateButton("Gabber", 480, 260, 165)

    $Video = GUICtrlCreateButton("Video", 165, 335, 100, 19)
    $Mp3 = GUICtrlCreateButton("Mp3", 390, 335, 100, 19)


    $label = GUICtrlCreateLabel(" Extrem Stream 2.0 created by: Gonzo", 300, 300, 630, 20)
    GUICtrlSetFont(-1, 12, 400, 0, "Comic Sans MS")
    GUICtrlSetColor(-1, 0xFF0000)
    GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)
    GUICtrlSetLimit(-1, 100, 0)
    GUISetState(@SW_SHOW, $main)
    $x = 1100
    AdlibRegister("Scroll_Label", 10)


    $videogui = GUICreate("Video Wiedergabe", 680, 380, -1, -1, -1, $WS_EX_COMPOSITED)
    GUISetBkColor(0x00000000)


    $Mp3gui = GUICreate("Mp3 Wiedergabe", 680, 380, -1, -1, -1, $WS_EX_COMPOSITED)
    GUISetBkColor(0x00000000)
    $Mp3Start = GUICtrlCreateButton("Play", 25, 320, 130,50)
    GUICtrlSetFont(-1, 20, 400, 0, "Comic Sans MS")
    GUICtrlSetBkColor(-1, 0x00FF0000)
    $Mp3Pause = GUICtrlCreateButton("Pause", 260, 320, 130,50)
    GUICtrlSetFont(-1, 20, 400, 0, "Comic Sans MS")
    GUICtrlSetBkColor(-1, 0x00FF0000)
    $Mp3Stop = GUICtrlCreateButton("Stop", 500, 320, 130,50)
    GUICtrlSetFont(-1, 20, 400, 0, "Comic Sans MS")
    GUICtrlSetBkColor(-1, 0x00FF0000)
    $Mp3Load = GUICtrlCreateButton("Load", 25, 20, 130,50)
    GUICtrlSetFont(-1, 20, 400, 0, "Comic Sans MS")
    GUICtrlSetBkColor(-1, 0x00FF0000)


    GUISetState(@SW_HIDE, $Mp3)
    GUISetState(@SW_HIDE, $Video)
    While 1
    $nMsg = GUIGetMsg(1)
    switch $nMsg[1]
    case $main
    Switch $nMsg[0]
    Case $GUI_EVENT_CLOSE
    AdlibUnRegister("Scroll_Label")
    Exit
    Case $start
    $oWMP = ObjCreate("WMPLayer.ocx")
    $oWMP.URL = "http://85.12.25.90:7500"
    $oWMP.controls.play()
    Case $stop
    $oWMP = ObjCreate("WMPLayer.ocx")
    $oWMP.controls.stop()
    Case $start2
    $oWMP = ObjCreate("WMPLayer.ocx")
    $oWMP.URL = "http://208.53.138.151:8032/"
    $oWMP.controls.play()
    Case $stop2
    $oWMP = ObjCreate("WMPLayer.ocx")
    $oWMP.controls.stop()
    Case $start3
    $oWMP = ObjCreate("WMPLayer.ocx")
    $oWMP.URL = "http://gffstream.ic.llnwd.net/stream/gffstream_mp3_w75a"
    $oWMP.controls.play()
    Case $stop3
    $oWMP = ObjCreate("WMPLayer.ocx")
    $oWMP.controls.stop()
    Case $start4
    $oWMP = ObjCreate("WMPLayer.ocx")
    $oWMP.URL = "http://streaming.radionomy.com:8000/12XIIIIX12"
    $oWMP.controls.play()
    Case $stop4
    $oWMP = ObjCreate("WMPLayer.ocx")
    $oWMP.controls.stop()
    Case $start5
    $oWMP = ObjCreate("WMPLayer.ocx")
    $oWMP.URL = "http://studio.njoyradio.at:8000"
    $oWMP.controls.play()
    Case $stop5
    $oWMP = ObjCreate("WMPLayer.ocx")
    $oWMP.controls.stop()
    Case $start6
    $oWMP = ObjCreate("WMPLayer.ocx")
    $oWMP.URL = "http://cp2.internet-radio.org.uk:30168/"
    $oWMP.controls.play()
    Case $stop6
    $oWMP = ObjCreate("WMPLayer.ocx")
    $oWMP.controls.stop()
    Case $start7
    $oWMP = ObjCreate("WMPLayer.ocx")
    $oWMP.URL = "http://listen.to.techno4ever.net"
    $oWMP.controls.play()
    Case $stop7
    $oWMP = ObjCreate("WMPLayer.ocx")
    $oWMP.controls.stop()
    Case $start8
    $oWMP = ObjCreate("WMPLayer.ocx")
    $oWMP.URL = "http://205.188.215.229:8040"
    $oWMP.controls.play()
    Case $stop8
    $oWMP = ObjCreate("WMPLayer.ocx")
    $oWMP.controls.stop()
    Case $start9
    $oWMP = ObjCreate("WMPLayer.ocx")
    $oWMP.URL = "http://stream2140.init7.net:80/"
    $oWMP.controls.play()
    Case $stop9
    $oWMP = ObjCreate("WMPLayer.ocx")
    $oWMP.controls.stop()
    Case $start10
    $oWMP = ObjCreate("WMPLayer.ocx")
    $oWMP.URL = "http://streaming.radionomy.com:8000/Schlagerhits"
    $oWMP.controls.play()
    Case $stop10
    $oWMP = ObjCreate("WMPLayer.ocx")
    $oWMP.controls.stop()
    Case $start11
    $oWMP = ObjCreate("WMPLayer.ocx")
    $oWMP.URL = "http://208.76.152.74:8000/"
    $oWMP.controls.play()
    Case $stop11
    $oWMP = ObjCreate("WMPLayer.ocx")
    $oWMP.controls.stop()
    Case $start12
    $oWMP = ObjCreate("WMPLayer.ocx")
    $oWMP.URL = "http://83.169.61.15:8000"
    $oWMP.controls.play()
    Case $stop12
    $oWMP = ObjCreate("WMPLayer.ocx")
    $oWMP.controls.stop()
    Case $start13
    $oWMP = ObjCreate("WMPLayer.ocx")
    $oWMP.URL = "http://91.121.176.72:8062"
    $oWMP.controls.play()
    Case $stop13
    $oWMP = ObjCreate("WMPLayer.ocx")
    $oWMP.controls.stop()
    Case $start14
    $oWMP = ObjCreate("WMPLayer.ocx")
    $oWMP.URL = "http://house.mthN.net:8500/"
    $oWMP.controls.play()
    Case $stop14
    $oWMP = ObjCreate("WMPLayer.ocx")
    $oWMP.controls.stop()
    Case $start15
    $oWMP = ObjCreate("WMPLayer.ocx")
    $oWMP.URL = "http://lime.citrus3.com:8076/"
    $oWMP.controls.play()
    Case $stop15
    $oWMP = ObjCreate("WMPLayer.ocx")
    $oWMP.controls.stop()
    Case $Mp3
    GUISetState(@SW_HIDE, $main)
    Guisetstate(@SW_SHOW, $Mp3gui)
    Case $video
    GUISetState(@SW_HIDE, $main)
    Guisetstate(@SW_SHOW, $videogui)
    EndSwitch


    case $Mp3gui
    Switch $nMsg[0]
    Case $GUI_EVENT_CLOSE
    GUISetState(@SW_SHOW, $main)
    Guisetstate(@SW_HIDE, $Mp3gui)
    EndSwitch


    case $videogui
    Switch $nMsg[0]
    Case $GUI_EVENT_CLOSE
    GUISetState(@SW_SHOW, $main)
    Guisetstate(@SW_HIDE, $videogui)
    EndSwitch
    EndSwitch
    WEnd


    Func Scroll_Label()
    GUICtrlSetPos($label, $x, 359)
    $x -= 1
    If $x = -400 Then $x = 600
    EndFunc ;==>Scroll_Label

    Einmal editiert, zuletzt von Gobana (19. Februar 2010 um 23:58)

  • Geht mit folgenden Funktionen:

    [autoit]


    _SoundPlay
    _SoundStop
    _SoundPause
    _SoundResume

    [/autoit]

    Andy hat mir ein Schnitzel gebacken aber da war ein Raupi drauf und bevor Oscar das Bugfixen konnte kam Alina und gab mir ein AspirinJunkie.

  • In der Hilfedatei sind Beispiele, z.B. dieses hier (sollte auf XP und Vista funktionieren):

    Spoiler anzeigen
    [autoit]

    #include <Sound.au3>

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

    ; Öffne Sound-Datei ; dies muß verändert werden, falls das Skript unter Vista läuft
    If @OSVersion = "WIN_XP", Then
    $sound = _SoundOpen(@WindowsDir & "\media\Windows XP Startup.wav")
    If @error = 2 Then
    MsgBox(0, "Fehler", "Die Datei existiert nicht.")
    Exit
    ElseIf @extended <> 0 Then
    $extended = @extended ; Zuweisung, weil @extended nach DllCall-Aufruf geändert wird
    $stText = DllStructCreate("char[128]")
    $errorString = DllCall("winmm.dll", "short", "mciGetErrorStringA", "str", $extended, "ptr", DllStructGetPtr($stText), "int", 128)
    MsgBox(0, "Fehler", "Öffnen fehlgeschlagen." & @CRLF & "Fehlernummer: " & $extended & @CRLF & "Fehlerbeschreibung: " & DllStructGetData($stText, 1) & @CRLF & "Beachte: Möglicherweise kann der Sound dennoch korrekt abgespielt werden.")
    Else
    MsgBox(0, "Erfolgsmeldung", "Die Datei wurde erfolgreich geöffnet.")
    EndIf
    _SoundPlay($sound, 1)

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

    _SoundClose($sound)
    Else
    $sound = _SoundOpen(@WindowsDir & "\media\Windows-Startvorgang.wav")
    If @error = 2 Then
    MsgBox(0, "Fehler", "Die Datei existiert nicht.")
    Exit
    ElseIf @extended <> 0 Then
    $extended = @extended ; Zuweisung, weil @extended nach DllCall-Aufruf geändert wird
    $stText = DllStructCreate("char[128]")
    $errorString = DllCall("winmm.dll", "short", "mciGetErrorStringA", "str", $extended, "ptr", DllStructGetPtr($stText), "int", 128)
    MsgBox(0, "Fehler", "Öffnen fehlgeschlagen." & @CRLF & "Fehlernummer: " & $extended & @CRLF & "Fehlerbeschreibung: " & DllStructGetData($stText, 1) & @CRLF & "Beachte: Möglicherweise kann der Sound dennoch korrekt abgespielt werden.")
    Else
    MsgBox(0, "Erfolgsmeldung", "Die Datei wurde erfolgreich geöffnet.")
    EndIf
    _SoundPlay($sound, 1)

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

    _SoundClose($sound)
    EndIf

    [/autoit]

    Wer immer nur das tut, was er bereits kann - wird auch immer nur das bleiben, was er bereits ist!