Tutorial 2: Sound Capture

This tutorial shows how to implement DirectSoundCapture to capture a sound (typically from the microphone input) and write it to a wave file.

The functions for creating, writing, and closing wave files are in Wave.c, a module 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: