Microsoft DirectX 8.0 (Visual Basic)

Step 1: Set Up the Audio System

The sample application declares the following object variables:

Private dx As New DirectX8
Private dml As DirectMusicLoader8
Private dmp As DirectMusicPerformance8
Private seg As DirectMusicSegment8

The only one of these objects that can be initialized during declaration is the DirectX8 object. DirectMusicLoader8 and DirectMusicPerformance8 must be created by using methods of this object, as follows:

Set dml = dx.DirectMusicLoaderCreate
Set dmp = dx.DirectMusicPerformanceCreate

After the performance has been created, it must be initialized. The DirectMusicPerformance8.InitAudio method performs the following tasks:

In the sample application, the call to InitAudio is very simple:

dmp.InitAudio Me.hWnd, DMUS_AUDIOF_ALL, dmA, Nothing, _
         DMUS_APATH_SHARED_STEREOPLUSREVERB, 64

Next: Step 2: Load a File