Solved

Change the properties of the mp3 file

Posted on 2006-11-27
5
5,145 Views
Last Modified: 2008-03-17
I like to change the properties of mp3 files like (title, genre, artist) within VB.net program.  I can change the properties manually but I like to change programmaticaly.

Is there a way that I can access the mp3 files and change the properties.

Please provide the code to get the full points.
0
Comment
Question by:tgatif
5 Comments
 
LVL 67

Accepted Solution

by:
sirbounty earned 350 total points
ID: 18020255
This should be close to what you need...

'code let's you change some ID3 metadata in one mp3 file.
  Dim id3 'As New CddbID3Tag
  Set id3 = CreateObject("CDDBControl.CddbID3Tag")
  id3.LoadFromFile "Z:\Work\94.01.09 rozsivani a sklizeni.mp3", False
  id3.Album = "Život za život"
  id3.Title = "Boží rozsívání a sklizeò"
  id3.CopyrightHolder = "Fotobit, s.r.o."
  id3.CopyrightYear = "2005"
  id3.FileId = "Ab-33-00025"
  id3.Genre = "Speech"
  id3.ISRC = "Ab-33-00025"
  id3.LeadArtist = "Alexandr Flek"
  id3.PartOfSet = "1"
  id3.Year = "1994/01/09 10:00"
  id3.Comments = "Remaster kázání 1 "
  id3.SaveToFile "Z:\Work\94.01.09 rozsivani a sklizeni.mp3"
 
      Second code is a VBScript batch which let's you change Artist field in all music or other sound mp3 files in one folder.
'Batch change ID3 tag Author In folder files
'2005 Antonin Foller, Motobit Software
Sub ChangArtist(sFolder, Artist)
 
  'get FileSystemObject To enumerate files
  Dim FS: Set FS = CreateObject("Scripting.FileSystemObject")
 
  'Get id3 object To change data
  Dim id3: Set id3 = CreateObject("CDDBControl.CddbID3Tag")
 
  'Enumerate folder files
  Dim File
  For Each File In FS.GetFolder(sFolder).Files
    'Select only mp3 files In the folder
    If LCase(Right(File.Name, 4)) = ".mp3" Then
      'Load id3 data from the file
      id3.LoadFromFile File.Path, False
     
      'Change Artist In the id3 data
      id3.LeadArtist = Artist
     
      'Save modified id3 data To the file
      id3.SaveToFile File.Path
    End If
  Next
End Sub
 
ref: http://www.motobit.com/tips/detpg_change-id3-tags-script/
0
 
LVL 9

Expert Comment

by:DjDezmond
ID: 18020512
I am half way through a project that is designed for batch processing of MP3 tags... The idea is you drag multiple files onto the form and it will read the titles, renaming it if need be (populating the ID tags as it goes along). It will eventually support command line params also (eg. MyApp.exe "C:\AllMyTunes").

It uses a DLL reference for the MP3 reading...

If it will be useful, I can post a link to the project on my server?
0
 

Author Comment

by:tgatif
ID: 18020933
@sirbounty

I tried the code as it is.  It executed well without any errors.

At the end of execution, it does not change the properties of the file.

Have you tried the code.?

Any suggestions
0
 
LVL 7

Assisted Solution

by:Mohamed Zedan
Mohamed Zedan earned 50 total points
ID: 18022363
Chances are that your mp3 files tag are ID3v2 or higher for this you need to use this library I did that application before for batch renaming of files and titles ...
you'll find this library very usefull ....
btw it's free :) ....

http://home.fuse.net/honnert/hundred/?UltraID3Lib
0
 
LVL 7

Expert Comment

by:Mohamed Zedan
ID: 18022365
there is a sample application on the site also in vb.net
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction When many people think of the WebBrowser (http://msdn.microsoft.com/en-us/library/2te2y1x6%28v=VS.85%29.aspx) control, they immediately think of a control which allows the viewing and navigation of web pages. While this is true, it's a…
Creating an analog clock UserControl seems fairly straight forward.  It is, after all, essentially just a circle with several lines in it!  Two common approaches for rendering an analog clock typically involve either manually calculating points with…
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

24 Experts available now in Live!

Get 1:1 Help Now