How to choose the input device
If the target system has more than one input device (sound card), compatible with DirectSound, you can record sound data from a specific input channel of a given input device.
With Windows XP, Windows Server 2003 and lower Windows versions, the number and friendly descriptions of available input devices (intended as sound cards) can be obtained through a prior call to the
GetInputDevicesCount and
GetInputDeviceDesc methods. The selected input device can be changed at a later time, but not during a recording session, using the
ChangeInputDevice method.
The number and friendly descriptions of available input channels (Microphone, Line-In, etc.), relative to a certain input device, can be obtained through a prior call to the
GetInputDeviceChannelsCount and
GetInputDeviceChannelDesc methods. The first place where you can choose the input channel for a given input device is the
InitRecorder method: during the container application execution, the default input channel for a certain input device can be changed through a call to the
SetInputDeviceChannelDefault method. The volume of the input channel can be changed through the
SetInputDeviceChannelVolume method.
Starting from Windows Vista, the behaviour of methods above will be slightly different: under Windows Vista each input channel is seen as a different sound card having one single input channel.
When a new USB device is plugged-in or unplugged, the container application will receive a
DeviceChange event: after receiving this event, if you need to remain in sync with available sound cards, you will have to reset the multimedia engine through the
ResetEngine method: after this resetting procedure (whose completion could require some second) it will be again possible enumerating available input devices through the
GetInputDevicesCount and
GetInputDeviceDesc methods. At this point you will have to re-initialize the control through the
ResetControl method.