|Microsoft DirectX 9.0|
The CaptureSound application shows how to capture waveforms to a file.
Source: (SDK root)\Samples\C++\DirectSound\CaptureSound
Executable: (SDK root)\Samples\C++\DirectSound\Bin
Select a device and a format. Create a file, or replace an existing one, by clicking Sound File. Click Record to start and stop recording.
The sample relies on notifications to ascertain when data should be read from the buffer. The notification positions are set up in the InitNotifications function, and the events are received in the WinMain function.