This tutorial shows how to create a simple DirectSound application that will play a wave file of any size.
The functions for opening, reading, and closing wave files are in Wave.c, a module that is found with the DSShow3D sample application in the DirectX SDK. In order to implement the techniques shown in the tutorial, you must add Wave.c and Wave.h to your project and link to Winmm.lib. You must also add Debug.c and Debug.h from the same sample directory, or else edit the calls to the ASSERT macro in Wave.c to call the standard assert function.
The method calls in this tutorial are made through the macros defined in Dsound.h, which are valid for both C and C++.
The tutorial is broken down into the following steps:
·Step 3: Create the Secondary Buffer
·Step 4: Set Up Play Notification
·Step 5: Handle the Play Notifications