|
-
Apr 16th, 2000, 04:54 AM
#1
MP3 Tag help
Help, How do I get the Id3 tags from an MP3. I need like, the artist, song name, and Genre.
please somebody help.
Thanks
~~~~~~~
AGbsa84
-
Apr 16th, 2000, 11:02 AM
#2
Addicted Member
If you read the actual MP3 file into your program you'll see the information stored at the end of the file, after the TAG keyword. It's just a matter of parsing the file's data from there.
-
Apr 16th, 2000, 08:46 PM
#3
transcendental analytic
I'm just working on a related project, so you may have my code:
Code:
Sub ID3splitTAG(ID3TAG, ID3Title, ID3Artist, ID3Album, ID3Year, ID3Comment, ID3Genre)
If Left(ID3TAG, 3) = "TAG" Then
ID3Title = RTrim(Mid(ID3TAG, 4, 30))
ID3Artist = RTrim(Mid(ID3TAG, 34, 30))
ID3Album = RTrim(Mid(ID3TAG, 64, 30))
ID3Year = Val(RTrim(Mid(ID3TAG, 94, 4)))
ID3Comment = RTrim(Mid(ID3TAG, 98, 30))
ID3Genre = Val(Asc(Mid(ID3TAG, 128, 1)))
End If
End Sub
Function ID3createTAG(ID3Title, ID3Artist, ID3Album, ID3Year, ID3Comment, ID3Genre)
ID3createTAG = "TAG" & Left(ID3Title & Space(30), 30) & Left(ID3Artist & Space(30), 30) & Left(ID3Album & Space(30), 30) & Left(ID3Year & Space(4), 4) & Left(ID3Comment & Space(30), 30) & Chr(Val(ID3Genre))
End Function
Function ID3getTAG(filename As String) As String
Dim astring As String * 128
ff = FreeFile
Open filename For Binary As ff
Get ff, LOF(ff) - 127, astring
Close ff
ID3getTAG = astring
End Function
Sub ID3setTAG(filename As String, aTAG As String)
Dim astring As String * 128: astring = aTAG
ff = FreeFile
Open filename For Binary As ff
If Left(ID3getTAG(filename), 3) = "TAG" Then
Put ff, LOF(ff) - 127, astring
Else
Put ff, LOF(ff) + 1, astring
End If
Close ff
End Sub
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
-
Apr 18th, 2000, 02:54 AM
#4
Thanks for the code, but how do I put it into my prog??? I tried but i don't quite understand it.
~~~~~~~
AGbsa84
-
Apr 21st, 2000, 08:20 PM
#5
A question for Kedaman
I have tried you code and it works great, but when trying to access file on a network computer shared as writeprotected the file wont open. You get "Runtime-Error 75 Path/File access error".
Im also working a simular project and ran into that problem too and sadly I havent solved It yet. Do you got any Idea how to solve it?
-
May 23rd, 2000, 08:39 AM
#6
Hyperactive Member
I am running his code, and I have all my MP3's stored on my UNIX network file server. I have no problem accessing those files. They are not read/write protected (by me anyway), but his code works file w/o errors.
Tom
-
May 23rd, 2000, 02:30 PM
#7
Fanatic Member
-
May 23rd, 2000, 03:08 PM
#8
transcendental analytic
Hi Kinjal, No i'm not working on a mp3-player, no decoding, i'm just attaching a full featured lyrics displayer to winamp that integrates the tags into mp3's.
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|