Solved

Change the properties of the mp3 file

Posted on 2006-11-27
5
5,257 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Well, all of us have seen the multiple EXCEL.EXE's in task manager that won't die even if you call the .close, .dispose methods. Try this method to kill any excels in memory. You can copy the kill function to create a check function and replace the …
A while ago, I was working on a Windows Forms application and I needed a special label control with reflection (glass) effect to show some titles in a stylish way. I've always enjoyed working with graphics, but it's never too clever to re-invent …
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 …

756 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