Re: Convert *.wma File Names to Text
- From: "George Bashore" <gbashore@xxxxxxxx>
- Date: Thu, 16 Feb 2006 13:03:40 -0500
Norm
Thanks for the info. It starts to make sense after I read your post and
this from MSDN.
Returns or sets an expression that stores any extra data needed for your
program. Unlike other properties, the value of the Tag property isn't used
by Visual Basic; you can use this property to identify objects.
I seem to have a problem with the genre. The code for Blues is 0 but it
shows up as -1. All the rest seem to work OK. I haven't tried the genres
are Winamp extensions. I change the code for RetVal(5) to
RetVal(5) = Asc(Trim(mp3info.genre)). Do you see any problems with this?
It seems to work OK.
George
"Norm Cook" <normcookNOSPAM@xxxxxxxxxxxx> wrote in message
news:11v966efbf2u78a@xxxxxxxxxxxxxxxxxxxxx
If you look at the Type MP3TagInfo you will see that it
totals 128 bytes. Since Id3 V1 MP3 tags are stored at the
end of the file,
Get #FF, FileLen(FileName) - 127, .tag
reads the last 128 bytes into the structure.
By convention, the first 3 bytes are "TAG" so
If Not .tag = "TAG" Then
is just checking for valid id3 tag.
"George Bashore" <gbashore@xxxxxxxx> wrote in message
news:usgoJ$vMGHA.2300@xxxxxxxxxxxxxxxxxxxxxxx
Ronuses
I've been reading up on this since I read your post. The mp3 and the wma
use similar but different tags. With bits and pieces of code found on
the
web I was able to get the tags (ID3) from mp3's but not the wma's which
another format (ASF). I still have to set up the genre tag to show textin
place of the number. Try this code with 2 list boxes. Change the paththe
to
your music folder that has your mp3's. I am going to try to figure out
tags for wma's.this
Option Explicit
Private Type MP3TagInfo
tag As String * 3
title As String * 30
artist As String * 30
album As String * 30
year As String * 4
comment As String * 30
genre As String * 1
End Type
Private Sub Form_Load()
Dim FileName As String
FileName = Dir("C:\Documents and Settings\George Bashore\My
Documents\My
Music\*.*")
Do While Len(FileName)
List1.AddItem FileName
FileName = Dir()
Loop
End Sub
Function GetMP3Info(ByVal FileName As String) As String()
Dim mp3info As MP3TagInfo
Dim RetVal(5) As String
Dim FF As Integer
FF = FreeFile
On Error Resume Next
Open FileName For Binary As FF
With mp3info
Get #FF, FileLen(FileName) - 127, .tag
If Not .tag = "TAG" Then
Close #FF
Exit Function
End If
Get #FF, , .title
Get #FF, , .artist
Get #FF, , .album
Get #FF, , .year
Get #FF, , .comment
Get #FF, , .genre
Close #FF
End With
RetVal(0) = Trim(mp3info.title)
RetVal(1) = Trim(mp3info.artist)
RetVal(2) = Trim(mp3info.album)
RetVal(3) = Trim(mp3info.year)
RetVal(4) = Trim(mp3info.comment)
RetVal(5) = CInt(Asc(Trim(mp3info.genre))) - 1
GetMP3Info = RetVal
End Function
Private Sub List1_Click()
List2.Clear
Dim myPick As String
Dim mp3info() As String
myPick = List1.Text
' Debug.Print myPick
mp3info = GetMP3Info("C:\Documents and Settings\George Bashore\My
Documents\My Music\" & myPick)
List2.AddItem "Title: " & mp3info(0)
List2.AddItem "Artist: " & mp3info(1)
List2.AddItem "Album: " & mp3info(2)
List2.AddItem "Year: " & mp3info(3)
List2.AddItem "Comment: " & mp3info(4)
List2.AddItem "Genre: " & mp3info(5)
End Sub
George
PS: Can Rick or LFS or one of the programmers is this group explain
bit of code.might
Get #FF, FileLen(FileName) - 127, .tag
If Not .tag = "TAG" Then
What is " -127 "and why " If Not .tag = "TAG" Then"
"Ron" <Ron@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:7D8C2756-FE38-46CB-8DFC-1C881B0A3A58@xxxxxxxxxxxxxxxx
Hi George
File contains name field with wma symbol,track no. and track name all
in
the same field
"George Bashore" wrote:
Ron
Does the wma file have an track name? I think it has an album and
file
title. The mp3 has a track number but no track name. I think you
filesbe
after the title.
George
"Ron" <Ron@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:6642EF41-24BB-42B9-A664-57765A756ADD@xxxxxxxxxxxxxxxx
Hi
I want to create a Music Ref. Library from my stored music *.wma
is
there a way to take the track name and convert this to text before
placing
in
a Access DB file
.
- Follow-Ups:
- Re: Convert *.wma File Names to Text
- From: Norm Cook
- Re: Convert *.wma File Names to Text
- References:
- Re: Convert *.wma File Names to Text
- From: George Bashore
- Re: Convert *.wma File Names to Text
- From: George Bashore
- Re: Convert *.wma File Names to Text
- From: Norm Cook
- Re: Convert *.wma File Names to Text
- Prev by Date: Re: Setting OLE Object Type to Null
- Next by Date: Re: Convert *.wma File Names to Text
- Previous by thread: Re: Convert *.wma File Names to Text
- Next by thread: Re: Convert *.wma File Names to Text
- Index(es):
Relevant Pages
|