Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

MP3 Properties and FSO 1

Status
Not open for further replies.

CasperTFG

Programmer
Nov 15, 2001
1,210
0
0
US
Hey all...

I'm trying to find a way of organizing my MP3's... I looked everywhere for a program to do this, but can't find one. So I've decided to make one.

What I want to do is have a program that I can rename MP3 files into the structure I want.

For example re-name them from the downloaded version of
'03-Dido(WhiteFlag)-GOOD-.mp3'
Into the format that I want to keep them on my Drive.

For example
Dido - White Flag - No Angel - 03.mp3
Artist - Song - Album - Track Number.mp3

So first off I started creating a Directory structure so that I could start off in a directory and look at all files in that and the sub-dirs to see if they were MP3s and then include thim in a list box.

Here I am having trouble getting into sub-directories.

Second when I click on the song, I want to get track details about it. For most of these MP3s if I play them Media Player knows who the artist is and what the track name and album are...

How do I get this?

Casper

"I feel sorry for people who don't drink. When they wake up in the morning, that's as good as they're going to feel all day."
~Frank Sinatra
 
Here is an example of getting all of the files from a given directory. You will need a Command Button (Command1) and a list Box (List1).

paste this code into the form
Code:
Private Sub Command1_Click()
    EnumerateFolderIntoList "c:\windows\"
End Sub

Public Sub EnumerateFolderIntoList(strFolder As String)
    Dim fso As Scripting.FileSystemObject
    Dim lCurrentFile As Scripting.File
    Dim lCurrentFolder As Scripting.Folder
    Dim lSubFolder As Scripting.Folder
    
    Set fso = New Scripting.FileSystemObject
    
    Set lCurrentFolder = fso.GetFolder(strFolder)
    
    For Each lCurrentFile In lCurrentFolder.Files
        If LCase(Right(lCurrentFile, 4)) = ".txt" Then
            List1.AddItem lCurrentFile.Path
        End If
        DoEvents
    Next
    
    For Each lSubFolder In lCurrentFolder.SubFolders
        'Enumerate all of the folders and get all of the files
        EnumerateFolderIntoList lSubFolder.Path
        
        For Each lCurrentFile In lSubFolder.Files
            If LCase(Right(lCurrentFile, 4)) = ".mp3" Then
                List1.AddItem lCurrentFile.Path
            End If
            DoEvents
        Next
        DoEvents
    Next
End Sub

If your doing the whole C drive you may want to look into the FindFirstFile/FindNextFile API's as they will be faster for searching for files. This should at least get you started with getting the files.
 
I'm sorry that I cannot help to solve this problem, but I just wanted to say that I too am very keen on knowing how to access the ID3v1 or ID3v2 information stored in the MP3-file format.

--
There's no place like 127.0.0.1
 
Hi there,
I know I'm not really aswering your question but I use a program that does what you seem to be trying to code. I got it as freeware off a magasine cover and it's called the godfather (tgf) if you want more details about it look here:
 
bjd4jc:
- Do you really think Find First find next is faster. I have heard many arguments on the board regarding both. I do want to search the whole C:\ so I would want to go the fastest way.

Overdoos:
- thanks for the tip about ID3v2 knowing what the format was called I found the following that may help guide me/us...

VB Samples
written in german but still a good VB smaple.
C++ samples

Casper

"I feel sorry for people who don't drink. When they wake up in the morning, that's as good as they're going to feel all day."
~Frank Sinatra
 
Hey thanks, CasperTFG.

Those links are just about what I needed... (star awarded)
 
I would be interested in helping out with such a project if you need it. I've always wanted to write one of these as well.
 
It may take me a while to write this one. I just got a new copy of .NET so since I'm writting this for fun, I thought it would be a good way to learn some .NET

Once I ahve a working version I'll post it on planet-sourcecode.com

Casper

"I feel sorry for people who don't drink. When they wake up in the morning, that's as good as they're going to feel all day."
~Frank Sinatra
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top