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:
Most of the examples of method calls throughout this section are given in the C language 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:
The same method call in the C++ form, which treats COM interface methods just like class methods, looks like this:
Dsound.h contains macros that expand to either the C or C++ form of the method call, depending on the environment. These macros simplify the C calls and also make it possible to develop routines that can be used in either language. For example:
Last updated on Tuesday, May 18, 2004
© 1992-2000 Microsoft Corporation. All rights reserved.