How to init two or more bass-es at the same time

Started by cooll,

cooll

Hello,

i have one problem. I don't know how to init two or more bass-es at the same time in Visual Basic.

Declare Function BASS_Init Lib "bass.dll" (ByVal device As Long, ByVal freq As Long, ByVal flags As Long, ByVal win As Long) As Long

BASS_Init (0, 44100, 0, Me.hWnD) - this will init bass.dll one time. But i have two sound cards in my computer and i would like to use both at the same time. So i should call BASS_Init two times with change on first parameter (device). But i dont know how to do it. Is it possible? If it is - does anyone has any samples or results for it?

bigjim

I assume that doing this in vb is similar to the way I've done it in delphi.

What you need to do is make a copy of bass.dll- rename it to something like bass2.dll

Get the module(bas) file I think it is that holds all the declares for bass and make a copy of it calling it something like bass2.bas

Edit bass2.bas and change each of the declarations to
Declare Function BASS_Init2 Lib "bass2.dll" Alias "BASS_Init" (ByVal device2 As Long, ByVal freq2 As Long, ByVal flags2 As Long, ByVal win2 As Long) As Long

See I've just told it to look at bass2.dll and said that this version of bass_init should be called bass_init2 but its really call BASS_Init.

Now just use bass and bass2.bas in your project and call bass_init on your first device and bass_init2 on your second device.

Hope this helps...
If you have any problems I'll post an example.


cooll

bigjim : OK i did it as you said and it works now. But here comes the problem if one user would have ex. 5 sound cards, then i need 5 bass.dll-s and 5x the same code. But it is even better than nothing. Thank you a lot !

Fiens

Thanks a lot but i think hat you proposition :

"If you have any problems I'll post an example."
will vry good for me.
Thanks



QuoteI assume that doing this in vb is similar to the way I've done it in delphi.

What you need to do is make a copy of bass.dll- rename it to something like bass2.dll

Get the module(bas) file I think it is that holds all the declares for bass and make a copy of it calling it something like bass2.bas

Edit bass2.bas and change each of the declarations to
Declare Function BASS_Init2 Lib "bass2.dll" Alias "BASS_Init" (ByVal device2 As Long, ByVal freq2 As Long, ByVal flags2 As Long, ByVal win2 As Long) As Long

See I've just told it to look at bass2.dll and said that this version of bass_init should be called bass_init2 but its really call BASS_Init.

Now just use bass and bass2.bas in your project and call bass_init on your first device and bass_init2 on your second device.

Hope this helps...
If you have any problems I'll post an example.