
Originally Posted by
BSA01
I know that, and I have done all.
In this DLL, I have module where I have directX functions, and in DLL I used reference quartz.dll.
Description of problem.
I want to use two sounds at the same time. First, I set module inside application. But if I want to load secund file, first will be replaced. And I can't play it. So, I decided to move that module in one DLL, so i can declare two object, Music1 as MyDll.clsPlay, Music as MyDll.clsPlay.
Using this DLL, I can't accomplish this task
for your first problem :
play more than one file at a time:
Code:
Type DirectShowbuf
Event As IMediaEvent
Control As IMediaControl
Position As IMediaPosition
Audio As IBasicAudio
Video As IBasicVideo
Video_Window As IVideoWindow
End Type
Function DSInit(DS As DirectShowbuf) As Boolean
On Error GoTo Error_Handler
Set DS.Control = New FilgraphManager
Set DS.Event = DS.Control
Set DS.Position = DS.Control
DS.Position.Rate = 1
DSInit = False
Exit Function
Error_Handler:
' Call ShowErrorMsg()
DSInit = True
End Function
you can use this last function to open as many devices as you want,
and thus play as many files as you want.
you should be aware what you're doing, because you need also to close those
devices.
you can for examples use an array to store each device, like this:
Code:
Dim DSArray[10] As DirectSHowBuf
Dim DSDeviceNum As Integer
Private Sub Form_Load()
For DSDeviceNum = 0 To 3
Call DSInit(DSArray(DSDeviceNum))
DSDeviceNum = DSDeviceNum + 1
Next
For DSDeviceNum = 0 To 3
DSArray(DSDeviceNum).Control.RenderFile (fName)
Next
End Sub