VB6.0 - How to add a Title to a MP3 Track dynamically?

vbimport

#1

Hi All,

Please suggest, how can I add track’s TITLES & AUTHOR to the MP3 files I am burning into a CD, using ‘NeroDrive’ ?

I using NeroCOM component(Nero 1.1 Type Library) & VB 6.0 to copy Audio files ( using NeroAudioTracks then calling BurnIsoAudioCD ) and it is working fine. But I can’t embed “Title” & “Author” to the tracks to MP3 tracks.

Please note, I am using ‘drive.BurnIsoAudioCD “”, “”, 0, isotrack, Nothing, Nothing, NERO_BURN_FLAG_SIMULATE + NERO_BURN_FLAG_WRITE, 0, NERO_MEDIA_CD’

and here I am passing “blank” for ‘artist’ & ‘Title’ option, but my problem is how can I dynamically read all different titles of my tracks from the “folder” and dynamically embed it to the burned CD’s MP3 files.

Here is my code …


Private Sub cmdBurn_Click()

Dim fileNum
btnAbort.Enabled = True
cmdBurn.Enabled = False
edtMessages3 = “”
edtMessages3.Refresh

Set Folder = New NeroFolder
Dim drives As INeroDrives
Set drives = nero.GetDrives(NERO_MEDIA_CDR)
Set drive = drives(AvailableDevices.ListIndex)
Dim isotrack As NeroISOTrack
Set isotrack = New NeroISOTrack
isotrack.Name = “TestTrack”
isotrack.RootFolder = Folder

fileNum = BurnFiles(Folder, ArchivePath)
strMessages = strMessages + “Prepared " & Format$(fileNum) & " files & Directories for writing.”
edtMessages3 = strMessages

isotrack.BurnOptions = NERO_BURN_OPTION_CREATE_ISO_FS Or NERO_BURN_OPTION_USE_JOLIET
drive.BurnIsoAudioCD “”, “”, 0, isotrack, Nothing, Nothing, NERO_BURN_FLAG_SIMULATE + NERO_BURN_FLAG_WRITE, 0, NERO_MEDIA_CD
GoTo quit

handle_error:
strMessages = strMessages + Err.Description + Chr(13) + Chr(10) + nero.LastError
edtMessages3 = strMessages
quit:
End Sub

Thanks a lot,

Anupdh


#2

but my problem is how can I dynamically read all different titles of my tracks from the “folder” and dynamically embed it to the burned CD’s MP3 files.
You need to use NERO_BURN_FLAG_CD_TEXT when burning your tracks (provided that your recorder supports this). Set Artist and Title properties of each of NeroAudioTracks.

If I understand your requirements, you are asking how to find out the artist/title information from the file names. This is really up to you to discover as file names might not even contain this information. If they do, it is usually in the form artist - title which would make it rather trivial to extract the required info.

If this is not what you were asking, please rephrase.


#3

Hi Alexp,

Thanks for the quick response. Let me re-phrase what I mean by “dynamically”.What I am trying to do is simply copy ALL the MP3 files from a folder to the CD. These MP3 files have different “Titles” & “Authors” when I see them in Windows Explorer, and I just want to copy these MP3 file’s attributes as it is to the CD using the NeroCOM.

Do I need to SET any flag ( or other setting) so that I can simply copy the “Titles” & “Author” along with the file or I have to get the each Track’s
“Title” & “Author” programatically and pass it each time for each track ?

For testing purpose, I set the flag ‘NERO_BURN_FLAG_CD_TEXT’ and Hard Coded “Title” & “Author” name ( same for all of my tracks) but still it is listing Artist as " Unknown" & Title as "Untitled " on the burned CD

Please see the code:


Artist = “Test Artist”
Title = “Test Title”

fileNum = BurnFiles(Folder, ArchivePath)
strMessages = strMessages + “Prepared " & Format$(fileNum) & " files & Directories for writing.”
edtMessages = strMessages

isotrack.BurnOptions = NERO_BURN_OPTION_CREATE_ISO_FS Or NERO_BURN_OPTION_USE_JOLIET

drive.BurnIsoAudioCD Artist, Title, 0, isotrack, Nothing, Nothing, NERO_BURN_FLAG_SIMULATE + NERO_BURN_FLAG_WRITE + NERO_BURN_FLAG_CD_TEXT, 0, NERO_MEDIA_CD
GoTo quit


BTW, I am using external burner ‘Memorex Ultraspeed CD Recorder’ ( 52x-32x-52x), hope this supports ‘NERO_BURN_FLAG_CD_TEXT’ Flag setting, any ideas ?

Thank you,

Anupdh


#4

I am still not sure what exactly you are talking about but I presume you are referring to ID3 tags? If you want to get artist/title from ID3 tags to automatically get written on the CD, this is not possible. You need to use some ID3 manipulation library in order to extract this information. I see no other way how Windows Explorer could report artist/title information for a MP3 file.

As far as the burn flags go, please try setting both NERO_BURN_FLAG_CD_TEXT as well as NERO_BURN_FLAG_DAO and see if it makes a difference.

BTW, I am using external burner ‘Memorex Ultraspeed CD Recorder’ ( 52x-32x-52x), hope this supports ‘NERO_BURN_FLAG_CD_TEXT’ Flag setting, any ideas ?
I suppose it does. You’d better check for NERO_CAP_DAO_WRITE_CD_TEXT flag in Capabilities property of NeroDrive or see if cd text is supported by checking the info in the “Choose Recorder” dialog in Nero.