Microsoft DirectX 8.1 (Visual Basic) |
For an application that is simply going to capture sounds through the user's preferred capture device, you don't need to enumerate the available devices. By passing vbNullString or a predefined GUID to DirectX8.DirectSoundCaptureCreate, you can create a default device. For more information, see Creating the DirectSoundCapture Object.
If you are looking for a particular kind of device or wish to offer the user a choice of devices, you must enumerate the devices available on the system.
Enumeration serves three purposes:
To enumerate devices, first call the DirectX8.GetDSCaptureEnum method to create a DirectSoundEnum8 object representing a collection of devices. You can then query each device by using the DirectSoundEnum8.GetDescription, DirectSoundEnum8.GetGuid, and DirectSoundEnum8.GetName methods.
For an example of the use of DirectSoundEnum8, see Enumeration of Sound Devices.