Hi again,
I'm trying to create a simple test code from your guide, but I get no sound.
I found BASS_Mixer_StreamAddChannel in the "Speakers" example of BassMix.
The example looks different that what I would (I play/stop/loop/fx channels/streams independantly), I tried just with adding a button to BASS_ChannelStop(Source) , it stop but with a latency (stop 0.5 sec after click on button).
I noticed the same latency with checking/unchecking Speaker 1 .
Is it normal ?
Edit :
I get some first results (I have sound AHAH !) with this code:
' Let the user choose the output devices
With frmDevice
.SelectDevice 1
.Show vbModal, Me
device(0) = .device
.SelectDevice 2
.Show vbModal, Me
device(1) = .device
End With
' setup output devices
If (BASS_Init(device(0), 44100, 0, Me.hWnd, 0) = 0) Then
Call Error_("Can't initialize device 1")
Unload Me
End If
If (BASS_Init(device(1), 44100, 0, Me.hWnd, 0) = 0) Then
Call Error_("Can't initialize device 2")
Unload Me
End If
Dim i As BASS_DEVICEINFO
Call BASS_GetDeviceInfo(device(0), i)
DeviceName(0).Caption = "Device 0 " & VBStrFromAnsiPtr(i.Name) & " "
Call BASS_GetDeviceInfo(device(1), i)
DeviceName(1).Caption = "Device 1 " & VBStrFromAnsiPtr(i.Name) & " "
Call BASS_SetDevice(device(0))
mixer = BASS_Mixer_StreamCreate(44100, 2, BASS_SAMPLE_FLOAT Or BASS_STREAM_DECODE) 'create a mixer
chan(0) = BASS_StreamCreateFile(BASSFALSE, StrPtr("1.mp3"), 0, 0, BASS_UNICODE)
chan(1) = BASS_StreamCreateFile(BASSFALSE, StrPtr("2.mp3"), 0, 0, BASS_UNICODE)
Call BASS_Mixer_StreamAddChannel(mixer, chan(0), 0)
Call BASS_Mixer_StreamAddChannel(mixer, chan(1), 0)
I get sound when I BASS_ChannelPlay chan(0) or chan(1), on the first device (so device(0) ) I selected.
But even with adding:
Dim ndev As Byte
For ndev = 0 To 1
Call BASS_SetDevice(device(ndev)) 'set device for n'th output
output(ndev) = BASS_Split_StreamCreate(mixer, 0, 0)
If ndev <> 0 Then Call BASS_ChannelSetLink(output(0), output(ndev)) 'link all outputs to the 1st output
Next ndev
Call BASS_ChannelStart(device(0)) 'start the outputs
I get no sound on device(1) .
I know you are not a VB6 user but I don't think it's a syntax problem: I have no error in IDE or at runtime.
BASS_ErrorGetCode on BASS_Split_StreamCreate(mixer, 0, 0) returns error 20, so output(ndev) is false (0), that probably explain that SetLik does not work.