Partager via


DirectSound Devices

[The feature associated with this page, DirectSound, is a legacy feature. It has been superseded by WASAPI and Audio Graphs. Media Casting have been optimized for Windows 10 and Windows 11. Microsoft strongly recommends that new code use Media Casting instead of DirectSound, when possible. Microsoft suggests that existing code that uses the legacy APIs be rewritten to use the new APIs if possible.]

The DirectSound device object represents a rendering device and is used to manage the device and to create sound buffers.

Multiple applications can create objects for the same sound device. When the input focus changes between applications, the audio output automatically switches from one application's streams to the other's. As a result, applications do not have to repeatedly play and stop their buffers when the input focus changes.

This section describes how your application can enumerate available sound devices, create the device object, and use the IDirectSound8 methods of the object to manage the device. The following topics are covered: