Microsoft DirectX 8.0 (Visual Basic) |
Initializes the performance and optionally sets up a default audiopath. This method must be called before the performance can play using audiopaths.
object.InitAudio( _ hwnd As Long, _ lFlags As CONST_DMUS_AUDIO, _ AudioParams As DMUS_AUDIOPARAMS, _ [DirectSound As DirectSound8], _ [lDefaultPathType As CONST_DMUSIC_STANDARD_AUDIO_PATH], _ [lPChannelCount As Long] )
This parameter is ignored if a DirectSound8 object is passed to the method in DirectSound. In that case the application is responsible for setting the window handle by using DirectSound8.SetCooperativeLevel.
If this parameter is a DirectSound8 variable set to Nothing, a DirectSound object is created and the variable is set to that object.
If this parameter is omitted, a private DirectSound8 object is created.
See Remarks.
If the method fails, an error is raised. Possible values for Err.Number include the following:
DMUS_E_ALREADY_INITED |
DMUS_E_OUTOFMEMORY |
This method can be called only once.
The performance must be terminated by using the DirectMusicPerformance8.CloseDown method before being released.
There should be only one DirectSound8 object per process. If your application uses DirectSound8 separately, it should pass that object in DirectSound. It must first set the cooperative level by passing DSSCL_PRIORITY to DirectSound8.SetCooperativeLevel.
You can pass 0 in the hwnd parameter to give the current foreground window handle to DirectSound. However, do not assume that the application window will be in the foreground during initialization. It is best to pass the top-level application window handle.
Parameters set in the lFlags and AudioParams parameters apply to the default audiopath and any audiopaths created subsequently.