Musik-Daten abrufen (Interpret etc.)

  • Ich habe nun in einem Beispiel ein Musikstück.... (.mp3)
    Nun möchte ich den Interpreten in eine externe Text-Datei aufschreiben !

    Glaube,dass geht mit irgendwas mit "ld3"-Tags o.ä.

    Könnte jemand die UDF (?) hochladen ?
    Oder erklären,wie man das macht?

    Spoiler anzeigen

    Nein,ich suche keine Fertiglösung... :D

    Zitat

    Programmieren ist so lange lustig bis ein Fehler auftritt!


    ~ Dankeschön

  • Wohin muss die .dll-Datei kopiert werden ?
    Edit: Ich bekomme alle Errors zu sehen,wieso ? Habe die .dll ins Scripverzeichnis kopiert.... Ich probier ma rum


    Ich rufe dein Script wiefolgt ab:

    Spoiler anzeigen
    [autoit]

    Func _id3tag($pfad)

    Global $file = $pfad
    MsgBox(0,"",$file)

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

    _DLLstartup()
    Global $re = _getID3Tag($file)
    If @error Then MsgBox(0, 'Error', 'Error - no array returned', 5)
    _ArrayDisplay($re)
    _setID3Tag($file, 'TrackPosition', 100)
    If @error Then MsgBox(0, 'Error', 'Error - setID3Tag', 5)
    _setID3Tag($file, 'TitleAlbum', 'Mega')
    If @error Then MsgBox(0, 'Error', 'Error - setID3Tag', 5)
    $re = _getID3Tag($file)
    If @error Then MsgBox(0, 'Error', 'Error - no array returned', 5)
    _ArrayDisplay($re)
    _DLLshutdown()


    EndFunc

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

    ;===================================================================================================

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

    ; 'TitleAlbum', 'Movie', 'Title', 'CopyrightYear', 'CopyrightHolder', 'Comments', 'Label', 'BeatsPerMinute',
    ; 'LeadArtist', 'PartOfSet', 'TrackPosition', 'Year', 'Genre', 'FileId', 'ISRC'
    ;===================================================================================================

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

    Func _setID3Tag($h_file, $detail, $value)
    Local $oId3 = ObjCreate("CDDBControl.CddbID3Tag")
    If Not IsObj($oId3) Then
    SetError(1)
    Return 0
    EndIf
    ; False means open for read-write
    $oId3.LoadFromFile ($h_file, False)

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

    Switch $detail
    Case 'TitleAlbum'
    $oId3.Album = $value
    Case 'LeadArtist'
    $oId3.LeadArtist = $value
    Case 'Title'
    $oId3.Title = $value
    Case 'TrackPosition'
    $oId3.TrackPosition = $value
    Case 'Year'
    $oId3.Year = $value
    Case 'Genre'
    $oId3.Genre = $value
    Case 'Comments'
    $oId3.Comments = $value
    Case 'Label'
    $oId3.Label = $value
    Case 'FileID'
    $oId3.FileId = $value
    Case 'IRSC'
    $oId3.ISRC = $value
    Case 'CopyrightHolder'
    $oId3.CopyrightHolder = $value
    Case 'CopyrightYear'
    $oId3.CopyrightYear = $value
    Case 'PartOfSet'
    $oId3.PartOfSet = $value
    Case 'Movie'
    $oId3.Movie = $value
    Case 'BeatsPerMinute'
    $oId3.BeatsPerMinute = $value
    Case Else
    SetError(2)
    Return 0
    EndSwitch
    $oId3.SaveToFile ($h_file)
    Return 1
    EndFunc ;==>_setID3Tag

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

    Func _getID3Tag($h_file)
    Local $oId3 = ObjCreate("CDDBControl.CddbID3Tag")
    If Not IsObj($oId3) Then
    SetError(1)
    Return 0
    EndIf
    $oId3.LoadFromFile ($h_file, False)
    Local $idTag_A[15][2]
    $idTag_A[0][0] = 'Title'
    $idTag_A[0][1] = $oId3.Title
    $idTag_A[1][0] = 'LeadArtist'
    $idTag_A[1][1] = $oId3.LeadArtist
    $idTag_A[2][0] = 'Album'
    $idTag_A[2][1] = $oId3.Album
    $idTag_A[3][0] = 'TrackPosition'
    $idTag_A[3][1] = $oId3.TrackPosition
    $idTag_A[4][0] = 'Year'
    $idTag_A[4][1] = $oId3.Year
    $idTag_A[5][0] = 'Genre'
    $idTag_A[5][1] = $oId3.Genre
    $idTag_A[6][0] = 'Comments'
    $idTag_A[6][1] = $oId3.Comments
    $idTag_A[7][0] = 'Label'
    $idTag_A[7][1] = $oId3.Label
    $idTag_A[8][0] = 'FileId'
    $idTag_A[8][1] = $oId3.FileId
    $idTag_A[9][0] = 'ISRC'
    $idTag_A[9][1] = $oId3.ISRC
    $idTag_A[10][0] = 'CopyrightHolder'
    $idTag_A[10][1] = $oId3.CopyrightHolder
    $idTag_A[11][0] = 'CopyrightYear'
    $idTag_A[11][1] = $oId3.CopyrightYear
    $idTag_A[12][0] = 'PartOfSet'
    $idTag_A[12][1] = $oId3.PartOfSet
    $idTag_A[13][0] = 'Movie'
    $idTag_A[13][1] = $oId3.Movie
    $idTag_A[14][0] = 'BeatsPerMinute'
    $idTag_A[14][1] = $oId3.BeatsPerMinute
    Return $idTag_A
    EndFunc ;==>_getID3Tag

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

    Func _DLLstartup($DLLpath = '')
    If $DLLpath = Default Or $DLLpath = '' Then $DLLpath = @ScriptDir & '\cddbcontrol.dll'
    ShellExecuteWait('regsvr32', '/s /i ' & $DLLpath, @WindowsDir, 'open', @SW_HIDE)
    EndFunc ;==>_DLLstartup

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

    Func _DLLshutdown($DLLpath = '')
    If $DLLpath = Default Or $DLLpath = '' Then $DLLpath = @ScriptDir & '\cddbcontrol.dll'
    ShellExecuteWait('regsvr32', ' /s /u ' & $DLLpath, @WindowsDir, 'open', @SW_HIDE)
    EndFunc ;==>_DLLshutdown

    [/autoit]

    Die .dll habich ins Windows UND system32-Ver5zeichnis kopiert

    Zitat

    Programmieren ist so lange lustig bis ein Fehler auftritt!


    ~ Dankeschön

    3 Mal editiert, zuletzt von Dankeschön (21. September 2008 um 11:53)

  • Hi,

    Spoiler anzeigen
    [autoit]

    Func _DLLstartup($DLLpath = '')
    If $DLLpath = Default Or $DLLpath = '' Then $DLLpath = @ScriptDir & '\cddbcontrol.dll'
    ShellExecuteWait('regsvr32', '/s /i ' & $DLLpath, @WindowsDir, 'open', @SW_HIDE)
    EndFunc ;==>_DLLstartup

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

    Func _DLLshutdown($DLLpath = '')
    If $DLLpath = Default Or $DLLpath = '' Then $DLLpath = @ScriptDir & '\cddbcontrol.dll'
    ShellExecuteWait('regsvr32', ' /s /u ' & $DLLpath, @WindowsDir, 'open', @SW_HIDE)
    EndFunc ;==>_DLLshutdown

    [/autoit]

    In den 2 Funktionen ist ein Fehler. Die DLL muss registriert werden, aber die Funktionen machen das nicht so, wie sie das sollen. Oscar und ich (wahrscheinlich die anderen auch :P) hatten das selbe Problem bei dem einen Wettbewerb. Schreib sie dir neu.

  • Zitat

    The requested action with this object has failed.:
    $oId3.LoadFromFile ($h_file, False)
    $oId3.LoadFromFile ($h_file, False)^ ERROR

    Habe das nun in

    Spoiler anzeigen
    [autoit]

    FileCopy(@ScriptDir & "\cddbcontrol.dll","C:\")
    RunWait("regsvr32 C:\cddbcontrol.dll",@SW_HIDE)
    Sleep(1000)

    [/autoit]


    geändert....

    Zitat

    Programmieren ist so lange lustig bis ein Fehler auftritt!


    ~ Dankeschön

  • Ja, das wäre jetzt der nächste Schritt gewesen, ich wollte nur wissen, ob das der Fehler überhaupt ist.

    Aber ein

    [autoit]

    RunWait("regsvr32" & " " & @ScriptDir & "\cddbcontrol.dll",@SW_HIDE)

    [/autoit]


    hätte es eigentlich auch getan.

  • Also,
    ich hab im moment keine Ahnung, was du machen willst, bzw. wie weit du bist. Wenn die DLL registriert ist funktioniert sie auch. Ich hab auch schon damit gearbeitet, funzt 1A.
    Ich weis nicht wie es weiter gehen soll, weil ich nicht weis was du von mir willst, ich rate eigetnlich die ganze zeit schon, einfach weil du nicht sagst was nicht Funktioniert.

  • Das Script von Xeno klappt nicht !

    Und dazu kommt die Fehlermeldung :

    Zitat

    C:\Dokumente und Einstellungen\Administrator\Desktop\Eigene Dateien\Music Player\Main.au3 (1353) : ==> The requested action with this object has failed.:
    $oId3.LoadFromFile ($h_file, False)
    $oId3.LoadFromFile ($h_file, False)^ ERROR

    Zitat

    Programmieren ist so lange lustig bis ein Fehler auftritt!


    ~ Dankeschön