This section gives a practical overview of how the various DirectSound interfaces are used in order to play and capture sound. The following topics are discussed:
Note Most of the examples of method calls throughout this section are given in the C form, which accesses methods by means of a pointer to a table of pointers to functions, and requires a this pointer as the first parameter in any call. For example, a C call to the IDirectSound::GetCaps method takes this form:
lpDirectSound->lpVtbl->GetCaps(lpDirectSound, &dscaps);
You can simplify C calls to any of the DirectSound methods by using the macros defined in Dsound.h. For example:
IDirectSound_GetCaps(lpDirectSound, &dscaps);
The same method call in the C++ form, which treats COM interface methods just like class methods, looks like this:
lpDirectSound->GetCaps(&dscaps);