For more information, see SDK Samples That Use the Core Audio APIs.
#AUDIODEVICE VALUE MICROSOFT WINDOWS#
The Windows SDK provides samples that include several implementations for the IMMNotificationClient Interface. If a client is interested only in certain event types or in certain devices, then the methods in its IMMNotificationClient implementation should filter the events appropriately. For more information, see IMMNotificationClient Interface.Ī client that is registered to receive device-event notifications will receive notifications of all types of device events that occur in all of the audio endpoint devices in the system. These calls pass a description of the event to the clients. When a device event occurs in an audio endpoint device, the MMDevice module calls the appropriate method in the IMMNotificationClient interface of every client that is currently registered to receive device-event notifications. The interface contains several methods, each of which serves as a callback routine for a particular type of device event. The IMMNotificationClient interface is implemented by a client.
Both methods take an input parameter, named pNotify, that is a pointer to an IMMNotificationClient interface instance.
When the client no longer requires notifications, it cancels them by calling the IMMDeviceEnumerator::UnregisterEndpointNotificationCallback method. To register to receive device notifications, a client calls the IMMDeviceEnumerator::RegisterEndpointNotificationCallback method. In this example, the transition from USB speakers to desktop speakers occurs automatically, without requiring the user to intervene by explicitly redirecting the application. In response to the event, if the application detects that a set of desktop speakers is connected to the integrated audio adapter on the system motherboard, the application can resume playing the audio track through the desktop speakers. In response to these notifications, the client can dynamically change the way that it uses a particular device, or select a different device to use for a particular purpose.įor example, if an application is playing an audio track through a set of USB speakers, and the user disconnects the speakers from the USB connector, the application receives a device-event notification. For more information about jack-presence detection, see Audio Endpoint Devices.Ī client can register to be notified when device events occur. For more information about the device states of audio endpoint devices, see DEVICE_STATE_XXX Constants. The first four items in the preceding list are examples of device state changes. The addition or removal of an audio adapter generates device events for all of the audio endpoint devices that connect to the adapter.
Please note that when you change the active audio device between calls, the device you set is not persisted after you close the Lync client. If a conversation is not going on, then setting this property changes default device so the set device will be used any time a new conversation starts. This change happens in mid call and is not remembered when that conversation ends. If a conversation is going on, then setting this changes the currently in used device to the new device. Property Microsoft::Lync::Model::Device::AudioDevice ^ ActiveAudioDevice member this.ActiveAudioDevice : .AudioDevice with get, set Public Property ActiveAudioDevice As AudioDevice Property Value AudioDevice Remarks