Change File Properties for Music Folder

R

Randy

This is just a quick algorithm for something that I am about to write:

Dim ActiveFolder as string
Dim fFileName as file '??
Dim strArtist as string
Dim strAlbum as string
Dim strTitle as string

For each fFileName in ActiveFolder
'Replace Contributing Artist with strArtist
'Replace Album with strAlbum
'Replace Title with strTitle
Next

Does anybody know what the code is for the three lines that begin with
Replace inside the loop?

Also, what is the variable type for fFileName?

Thanks,
Randy
 
O

Onur Güzel

This is just a quick algorithm for something that I am about to write:

Dim ActiveFolder as string
Dim fFileName as file '??
Dim strArtist as string
Dim strAlbum as string
Dim strTitle as string

For each fFileName in ActiveFolder
   'Replace Contributing Artist with strArtist
   'Replace Album with strAlbum
   'Replace Title with strTitle
Next

Does anybody know what the code is for the three lines that begin with
Replace inside the loop?

Also, what is the variable type for fFileName?

Thanks,
Randy

Actually, you're just trying to modify the metadata attributes of a
media file, highly possible as an Windows Media File, such as WMA. In
case of this, you need to deal with some API like Windows Media Player
or Windows Media SDK. Changing such attributes of a music file can be
done using Windows Media Player control which can be added to your
toolbox. A similar solution, i had posted here:

http://groups.google.com/group/micr...811f28ca0ee7a7?hl=en&q=title#21811f28ca0ee7a7

Me.AxWindowsMediaPlayer1.mediaCollection.add _
("c:\file.wmv").setItemInfo("Title", "title_here")

A list of these attributes can be found here:
http://msdn.microsoft.com/en-us/library/dd743066(v=vs.85).aspx

Once you use the API, you're ready to change attributes in / or out of
a loop.

HTH,

Onur Güzel
 
R

Randy

You are right. However, I am trying to write a program so that this
can be done en masse to entire folders. I have a number of mp3 files
from business meetings that I am trying to organize, but the Windows
Explorer and WMP interfaces are painfully slow. I have to open the
properties of each file one by one and type in the changes to the
metadata attributes individually and over and over again. I'm sure
that this can be done programatically, but I don't know what the code
would be to get at these attribute entries.
 
O

Onur Güzel

You are right.  However, I am trying to write a program so that this
can be done en masse to entire folders.  I have a number of mp3 files
from business meetings that I am trying to organize, but the Windows
Explorer and WMP interfaces are painfully slow.  I have to open the
properties of each file one by one and type in the changes to the
metadata attributes individually and over and over again.  I'm sure
that this can be done programatically, but I don't know what the code
would be to get at these attribute entries.

As stated, once you've added right WMP SDK (like WMP control) you're
allowed to change these attributes programatically. Changing title is
done like in the example in my previous post.

Loooping through the files is simple as using System.IO.File.GetFiles
method.

A design hint: You would load the file paths in a listbox/listview
than select files and get attributes using GetItemInfo, load
attributes to a corresponding textboxes to let client edit in a new
form. Put a save button on that form (edit form), use setItemInfo to
save in save button's click event handler.

Design 'may' vary depending on your project.

HTH,

Onur
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top