title image


Smiley Re: Steuerelement zum abspielen von MP3s
Zuerst ein Modul (clsMP3) mit dem Inhalt:Option Explicit' Title: MP3 Snatch' Author: Leigh Bowers' Version: 2.0' Released: 1st June 1999' WWW: http://www.esheep.freeserve.co.uk/compulsion/index.html' Email: compulsion@esheep.freeserve.co.uk' News: Added "Genre" functionality (WinAMP compliant)Private sFilename As String'ClsPrivate Type Info sTitle As String * 30 sArtist As String * 30 sAlbum As String * 30 sComment As String * 30 sYear As String * 4 sGenre As String * 21 ' NEWEnd TypePrivate MP3Info As InfoPublic Property Get Filename() As String Filename = sFilenameEnd PropertyPublic Property Let Filename(ByVal sPassFilename As String) Dim iFreefile As Integer Dim lFilePos As Long Dim sData As String * 128 Dim sGenreMatrix As String Dim sGenre() As String Dim x ' Genre sGenreMatrix = "Blues|Classic Rock|Country|Dance|Disco|Funk|Grunge|" + _ "Hip-Hop|Jazz|Metal|New Age|Oldies|Other|Pop|R&B|Rap|Reggae|Rock|Techno|" + _ "Industrial|Alternative|Ska|Death Metal|Pranks|Soundtrack|Euro-Techno|" + _ "Ambient|Trip Hop|Vocal|Jazz+Funk|Fusion|Trance|Classical|Instrumental|Acid|" + _ "House|Game|Sound Clip|Gospel|Noise|Alt. Rock|Bass|Soul|Punk|Space|Meditative|" + _ "Instrumental Pop|Instrumental Rock|Ethnic|Gothic|Darkwave|Techno-Industrial|Electronic|" + _ "Pop-Folk|Eurodance|Dream|Southern Rock|Comedy|Cult|Gangsta Rap|Top 40|Christian Rap|" + _ "Pop/Punk|Jungle|Native American|Cabaret|New Wave|Phychedelic|Rave|Showtunes|Trailer|" + _ "Lo-Fi|Tribal|Acid Punk|Acid Jazz|Polka|Retro|Musical|Rock & Roll|Hard Rock|Folk|" + _ "Folk/Rock|National Folk|Swing|Fast-Fusion|Bebob|Latin|Revival|Celtic|Blue Grass|" + _ "Avantegarde|Gothic Rock|Progressive Rock|Psychedelic Rock|Symphonic Rock|Slow Rock|" + _ "Big Band|Chorus|Easy Listening|Acoustic|Humour|Speech|Chanson|Opera|Chamber Music|" + _ "Sonata|Symphony|Booty Bass|Primus|Porn Groove|Satire|Slow Jam|Club|Tango|Samba|Folklore|" + _ "Ballad|power Ballad|Rhythmic Soul|Freestyle|Duet|Punk Rock|Drum Solo|A Capella|Euro-House|" + _ "Dance Hall|Goa|Drum & Bass|Club-House|Hardcore|Terror|indie|Brit Pop|Negerpunk|Polsk Punk|" + _ "Beat|Christian Gangsta Rap|Heavy Metal|Black Metal|Crossover|Comteporary Christian|" + _ "Christian Rock|Merengue|Salsa|Trash Metal|Anime|JPop|Synth Pop" ' Build the Genre array (VB6+ only) sGenre = Split(sGenreMatrix, "|") ' Store the filename (for "Get Filename" property) sFilename = sPassFilename ' Clear the info variables MP3Info.sTitle = "" MP3Info.sArtist = "" MP3Info.sAlbum = "" MP3Info.sYear = "" MP3Info.sComment = "" ' Ensure the MP3 file exists If Dir(sFilename) = "" Then Exit Property ' Retrieve the info data from the MP3 iFreefile = FreeFile lFilePos = FileLen(sFilename) - 127 Open sFilename For Binary As #iFreefile Get #iFreefile, lFilePos, sData Close #iFreefile ' Populate the info variables If Left(sData, 3) = "TAG" Then MP3Info.sTitle = Mid(sData, 4, 30) MP3Info.sArtist = Mid(sData, 34, 30) MP3Info.sAlbum = Mid(sData, 64, 30) MP3Info.sYear = Mid(sData, 94, 4) MP3Info.sComment = Mid(sData, 98, 30) If Len(sData) > 128 Then MP3Info.sGenre = sGenre(Asc(Mid(sData, 128, 1))) End If End PropertyPublic Property Get Title() As String Title = RTrim(MP3Info.sTitle)End PropertyPublic Property Get Artist() As String Artist = RTrim(MP3Info.sArtist)End PropertyPublic Property Get Genre() As String Genre = RTrim(MP3Info.sGenre)End PropertyPublic Property Get Album() As String Album = RTrim(MP3Info.sAlbum)End PropertyPublic Property Get Year() As String Year = MP3Info.sYearEnd PropertyPublic Property Get Comment() As String Comment = RTrim(MP3Info.sComment)End PropertyDanach in der Sub einfach folgendes Kommando benutzen: MP3.Filename = "C:\haumichblau.mp3" ID3Artist = MP3.Artist ID3Title = MP3.Title ID3Album = MP3.Album ID3Year = MP3.Year ID3Comment = MP3.Comment ID3Genre = MP3.GenreSorry, falls es nicht so fein war, hier den ganzen Source zu posten - aber ich denke mal, das interessiert noch mehrere.Jetzt bleibt nur noch die Frage (die mich auch brennend interessiert): Wie lese ich bps und Track-Länge aus?!?

geschrieben von

Login

E-Mail:
  

Passwort:
  

Beitrag anfügen

Symbol:
 
 
 
 
 
 
 
 
 
 
 
 
 

Überschrift: