Hello Thomas,
due to the internal architecture, there are the following limitations that apply to your code:
- a single instance of the DJ studio component cannot create multiple stream mixers: only one is allowed.
- you can record from a specific stream mixer using one single instance of the recorder only
- a player can be attached to a single stream mixer only
We have verified that these points are not well documented so we will have to update the documentation accordingly.
Anyway, in order to achieve what you are trying to do, you should use a second instance of Audio DJ Studio and a code similar to the one below:
Dim smc1 As Short
Dim smc2 As Short
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
AudioDjStudio1.InitSoundSystem(1, 0, 0, 0, 0, -1)
AudioDjStudio2.InitSoundSystem(1, 0, 0, 0, 0, -1)
AudioSoundRecorder1.InitRecorder(0, -1)
AudioSoundRecorder2.InitRecorder(0, -1)
smc1 = AudioDjStudio1.StreamMixerCreate(0, 48000, 2) 'always get 3000 here
AudioDjStudio1.StreamMixerPlayerAdd(smc1, 0)
smc2 = AudioDjStudio2.StreamMixerCreate(0, 48000, 2)
AudioDjStudio2.StreamMixerPlayerAdd(smc2, 0)
AudioDjStudio1.LoadInternetStream(0, strURL)
AudioDjStudio2.LoadInternetStream(0, strURL)
AudioSoundRecorder1.EncodeFormatForRecording = AudioSoundRecorder.enumEncodingFormats.ENCODING_FORMAT_MP3
AudioSoundRecorder1.EncodeMp3Mode = enumMp3EncodeModes.MP3_ENCODE_CBR
AudioSoundRecorder1.EncodeMp3CBR = 48000
AudioSoundRecorder2.EncodeFormatForRecording = AudioSoundRecorder.enumEncodingFormats.ENCODING_FORMAT_MP3
AudioSoundRecorder2.EncodeMp3Mode = enumMp3EncodeModes.MP3_ENCODE_CBR
AudioSoundRecorder2.EncodeMp3CBR = 48000
ButtonStart1.Enabled = False
ButtonStart2.Enabled = False
End Sub
Private Sub AudioDjStudio1_StreamLoaded(ByVal sender As System.Object, ByVal e As AudioDjStudio.StreamLoadedEventArgs) Handles AudioDjStudio1.StreamLoaded
AudioDjStudio1.PlaySound(0)
ButtonStart1.Enabled = True
End Sub
Private Sub AudioDjStudio2_StreamLoaded(ByVal sender As System.Object, ByVal e As AudioDjStudio.StreamLoadedEventArgs) Handles AudioDjStudio2.StreamLoaded
AudioDjStudio2.PlaySound(0)
ButtonStart2.Enabled = True
End Sub
Private Sub ButtonStart1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonStart1.Click
AudioSoundRecorder1.Stop()
AudioSoundRecorder1.StartFromDjStudioMixer(smc1, "c:\zz.mp3")
End Sub
Private Sub ButtonStart2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonStart2.Click
AudioSoundRecorder2.Stop()
AudioSoundRecorder2.StartFromDjStudioMixer(smc2, "c:\zz2.mp3")
End Sub
Hope this helps
Kind regards
Severino Delaurenti
MultiMedia Soft