Solved

Change the properties of the mp3 file

Posted on 2006-11-27
5
5,123 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

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

This tutorial demonstrates one way to create an application that runs without any Forms but still has a GUI presence via an Icon in the System Tray. The magic lies in Inheriting from the ApplicationContext Class and passing that to Application.Ru…
Article by: jpaulino
XML Literals are a great way to handle XML files and the community doesn’t use it as much as it should.  An XML Literal is like a String (http://msdn.microsoft.com/en-us/library/system.string.aspx) Literal, only instead of starting and ending with w…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

762 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

23 Experts available now in Live!

Get 1:1 Help Now