PDA

Click to See Complete Forum and Search --> : best way to do this...


DiGiTaIErRoR
Jan 23rd, 2000, 07:21 PM
at the end of every mp3 file is it's TAG tells you various info about the mp3...
how would I go about getting this info?
it looks something like this:
---
TAGFireStarter Prodigy Fat o' The land! 1999Digital's a FireStarter! 
---
Thanks

------------------
DiGiTaIErRoR

Serge
Jan 23rd, 2000, 09:36 PM
Tags are saved as last 128 bytes in the MP3 file.

Dim strPath As String
Dim intFFN As Integer
Dim strBuffer As String
Dim lngRec As Long
Dim strTitle As String
Dim strArtist As String
Dim strAlbum As String
Dim strMsg As String

strPath = "C:\MyMp.mp3"
intFFN = FreeFile
Open strPath For Binary As intFFN
lngRec = LOF(intFFN) - 128
strBuffer = Space(128)
Get #intFFN, lngRec, strBuffer
Close #intFFN
strTitle = Mid(strBuffer, InStr(strBuffer, "TAG") + 3, 30)
strArtist = Trim(Mid(strBuffer, 31, 30))
strAlbum = Trim(Mid(strBuffer, 61, 30))
strMsg = "Title: " & strTitle & vbCrLf
strMsg = strMsg & "Artist: " & strArtist & vbCrLf
strMsg = strMsg & "Album: " & strAlbum
MsgBox strMsg



------------------

Serge

Programmer Analyst
sdymkov@microage.com
Access8484@aol.com
ICQ#: 51055819 (http://www.icq.com/51055819)

VB-LEANER
Jan 24th, 2000, 12:35 AM
just wondering is there a way that u can edit and save the mp3 tag thru a vb app???

------------------

chrisjk
Jan 24th, 2000, 03:20 AM
Read in the entire file, edit the bit you are interested in, write file back out again. Simple..? :)

------------------
- Chris
chris.kilhams@btinternet.com
If it ain't broke - don't fix it :)

Jan 26th, 2000, 03:29 AM
serge that code doens't work when i run it

aussiejoe
Jan 26th, 2000, 03:31 PM
maybe his code doesnt work exactly, but he told you all you need to know to make your own, just read the file, and experiment till you get it right ;)