|
|
Title | Use a FilgraphManager to play a WAV file |
Description | This example shows how to use a FilgraphManager to play a WAV file in Visual Basic 6. |
Keywords | FilgraphManager, WAV, audio, media |
Categories | Multimedia |
|
|
Thanks to Gamal Azim.
This example plays a .wav file. It includes a reference to the ActiveMovie control type library. The most interesting code is the start subroutine, which creates a FilgraphManager and uses its RenderFile method to play the .wav file.
|
|
Sub start()
If Dir(cd1.FileName) = "" Or cd1.FileName = "" Then
strSound = App.Path + "\Lacool.wav"
Set MediaControl = New FilgraphManager
MediaControl.RenderFile strSound
MediaControl.Run
Else
strSound = cd1.FileName
Set MediaControl = New FilgraphManager
MediaControl.RenderFile strSound
MediaControl.Run
End If
End Sub
|
|
|
|
|
|