How can I Burn AudioTracks with VB & NeroCOM?

vbimport

#1

Sorry my english…

I wanna burn some mp3 files to a AudioCD…
I just can burn 1 mp3…
I have tried to 1 file:
'----------------------------------------------------------------------
Dim drives As INeroDrives
Set drives = nero.GetDrives(NERO_MEDIA_CDR)
Set drive = drives(AvailableDevices.ListIndex)
Dim MusicTrack As NeroAudioTrack
Set MusicTrack = New NeroAudioTrack
Dim list As NeroAudioTracks
Set list = New NeroAudioTracks
MusicTrack.FileName = NameFromPath(edtFileName.Text)
MusicTrack.TrackType = NERO_AUDIO_TRACK_FILE_MP3
list.Add MusicTrack

drive.BurnIsoAudioCD "Pop Star", "Title", 0, Nothing, list, _ Nothing, NERO_BURN_FLAG_WRITE, 52, NERO_MEDIA_CD

'----------------------------------------------------------------------

that code work just with 1 file…
i have tried to multiple files:
'----------------------------------------------------------------------
Dim drives As INeroDrives
Set drives = nero.GetDrives(NERO_MEDIA_CDR)
Set drive = drives(AvailableDevices.ListIndex)
Dim MusicTrack(2) As NeroAudioTrack
Set MusicTrack(2) = New NeroAudioTrack '!!!ERROR HERE!!!
Dim list As NeroAudioTracks
Set list = New NeroAudioTracks
Dim a As Integer
For a = 0 To edtFileName.ListCount - 1
MusicTrack(a).FileName = NameFromPath(edtFileName.List(a))
MusicTrack(a).TrackType = NERO_AUDIO_TRACK_FILE_MP3
list.Add MusicTrack(a)
Next

drive.BurnIsoAudioCD "Pop Star", "Title", 0, Nothing, list, _ Nothing, NERO_BURN_FLAG_WRITE, 52, NERO_MEDIA_CD

'----------------------------------------------------------------------

I can burn with that code and i need do it

Plz help me

Sorry my english again…


#2

Well off the bat:

the line: Set MusicTrack (2) = New NeroAudioTrack

should not run because you can’t do it just for the 3rd element of the array.l

Ideally you could put:

Set MusicTrack(a) = New NeroAudioTrack

into the loop??

Give that a try.