Solved

Change the properties of the mp3 file

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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Exit the loop 4 49
Run a batch file when a Crystal Report is opened 5 48
cannot connect to sqlserver 8 34
VB.net Open video relating to control 2 19
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

808 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