tried that but still havin no joy with the xml file it is continuing to write the full path indstead of just
<?xml version="1.0"?>
<songs>
<song path="my_mp3s/.mp3"artist="" title=""/>
</songs>
End SubVB Code:
Private Sub Command2_Click() Dim f1 As Integer, xmlpath As String, songpath As String, mp3path As String, f2 As Integer, i As Integer Dim MyPath As String Dim Artist As String, SongName As String, artname As String, fname As String, mp3Path2 As String Dim mytag As Boolean mp3path = "C:\Program Files\mgamerz\my_mp3s\" xmlpath = "C:\program files\mgamerz\ " MyPath = Right(mp3path, (Len(mp3path) - Len(xmlpath) + 1)) mp3Path2 = "my_mp3s\" SongName = Dir(mp3path & "\*.mp3") fname = mp3path & SongName With Form4 While Not Len(SongName) = 0 ' Artist = GetMP3Tag(fname) If Not i = 0 Then Load .Label1(i): Load .Text1(i) .Label1(i).Top = .Label1(i - 1).Top + 350 .Text1(i).Top = .Text1(i - 1).Top + 350 .Label1(i).Visible = True: .Text1(i).Visible = True End If .Label1(i) = SongName mytag = GetMP3Tag(fname) .Text1(i) = RTrim(MP3Info.sArtist) SongName = Dir fname = mp3path & SongName i = i + 1 Wend .Height = .Text1(.Text1.Count - 1).Top + 1600 .TAG = mp3path MDIForm1.Caption = "You must close this form before continuing" .Show ' .WindowState = 2 End With TAG = "wait" While TAG = "wait" DoEvents Wend i = 1 f2 = FreeFile Open mp3path & "mp3.txt" For Output As #f2 f1 = FreeFile Open xmlpath & "audiolist.xml" For Output As #f1 Print #f1, "<?xml version=""1.0""?>" Print #f1, "<songs>" SongName = Dir(mp3path & "\*.mp3") i = 1 While Not Len(SongName) = 0 ' if you can return the name of the artist you put the code in here mytag = GetMP3Tag(mp3path & SongName) Artist = RTrim(MP3Info.sArtist) If Len(Artist) = 0 Then Artist = "UNKOWN" songpath = "<song path=""" & MyPath & """ artist=""" & Artist & """ title=""" & SongName & """/> " Print #f1, songpath Print #f2, SongName Sleep 100 SongName = Dir Wend Print #f1, "</songs>" Close




Reply With Quote