Switching Preferred Audio Devices

TheWaveform Audio interface includes functionality to query and set the preferredaudio device. Messages are sent using the waveInMessage and waveOutMessagefunctions.

Thefollowing table shows the messages that retrieve and set the audio device ids.

Message

Description

DRVM_MAPPER_PREFERRED_SET

This message is sent to the audio driver to configure the device  ID of an audio device.

DRVM_MAPPER_PREFERRED_GET

This message is sent to the audio driver to query the current  device ID of an audio device.

Whenan audio device is added or removed from the system, or when the preferredaudio device changes, RequestDeviceNotifications is usedto notify interested applications of the new device configuration. Anapplication registers to be notified of changes by passing a GUID specifyingwhich device class it is interested in and a message queue handle into which amessage should be posted when a notification occurs.

TwoGUIDs are defined for audio devices, one for wave output and one for waveinput. The definitions are as follows:

Copy

//{25D535D0-5D7A-4a35-9741-ECD0B09FDB46}

DEFINE_GUID(DEVCLASS_WAVEOUT_GUID,

0x25d535d0,0x5d7a, 0x4a35, 0x97, 0x41, 0xec, 0xd0, 0xb0, 0x9f, 0xdb, 0x46);


//{4A7B3B17-0996-4a91-9C09-C28EB44295D7}

DEFINE_GUID(DEVCLASS_WAVEIN_GUID,

0x4a7b3b17, 0x996, 0x4a91, 0x9c,0x9, 0xc2, 0x8e, 0xb4, 0x42, 0x95, 0xd7);

Whenan application receives a device change notification in its associated messagequeue, the notification will include a DEVDETAILstructure containing the GUID information.


你可能感兴趣的:(device,Wave,switching)