public class MMDeviceEnumerator : ComObject
Provides methods for enumerating multimedia device resources.
MMDeviceEnumerator()
Initializes a new instance of the MMDeviceEnumerator class.
public void MMDeviceEnumerator()
DefaultAudioEndpoint(DataFlow dataFlow, Role role)
Returns the default audio endpoint for the specified data-flow direction and role.
public static MMDevice DefaultAudioEndpoint(DataFlow dataFlow, Role role)
Parameters
dataFlow
DataFlowThe data-flow direction for the endpoint device.
role
RoleThe role of the endpoint device.
Returns
MMDevice instance of the endpoint object for the default audio endpoint device.
EnumAudioEndpoints(DataFlow dataFlow, DeviceState stateMask)
Generates a collection of audio endpoint devices that meet the specified criteria.
public MMDeviceCollection EnumAudioEndpoints(DataFlow dataFlow, DeviceState stateMask)
Parameters
dataFlow
DataFlowThe data-flow direction for the endpoint device.
stateMask
DeviceStateThe state or states of the endpoints that are to be included in the collection.
Returns
MMDeviceCollection which contains the enumerated devices.
EnumAudioEndpointsNative(DataFlow dataFlow, DeviceState stateMask, IntPtr& collection)
Generates a collection of audio endpoint devices that meet the specified criteria.
public Int32 EnumAudioEndpointsNative(DataFlow dataFlow, DeviceState stateMask, IntPtr& collection)
Parameters
dataFlow
DataFlowThe data-flow direction for the endpoint device.
stateMask
DeviceStateThe state or states of the endpoints that are to be included in the collection.
collection
IntPtr&A pointer variable into which the method writes the address of the MMDeviceCollection COM object of the device-collection object.
Returns
HRESULT
GetDefaultAudioEndpoint(DataFlow dataFlow, Role role)
Returns the default audio endpoint for the specified data-flow direction and role.
public MMDevice GetDefaultAudioEndpoint(DataFlow dataFlow, Role role)
Parameters
dataFlow
DataFlowThe data-flow direction for the endpoint device.
role
RoleThe role of the endpoint device.
Returns
MMDevice instance of the endpoint object for the default audio endpoint device.
GetDefaultAudioEndpointNative(DataFlow dataFlow, Role role, IntPtr& device)
The GetDefaultAudioEndpoint method retrieves the default audio endpoint for the specified data-flow direction and role.
public Int32 GetDefaultAudioEndpointNative(DataFlow dataFlow, Role role, IntPtr& device)
Parameters
dataFlow
DataFlowThe data-flow direction for the endpoint device.
role
RoleThe role of the endpoint device.
device
IntPtr&A pointer variable into which the method writes the address of the MMDevice COM object of the endpoint object for the default audio endpoint device.
Returns
HRESULT
GetDevice(String id)
Retrieves an audio endpoint device that is identified by an endpoint ID string.
GetDeviceNative(String id, IntPtr& device)
Retrieves an audio endpoint device that is identified by an endpoint ID string.
public Int32 GetDeviceNative(String id, IntPtr& device)
Parameters
id
StringEndpoint ID. The caller typically obtains this string from the DeviceID property or any method of the IMMNotificationClient.
device
IntPtr&A pointer variable into which the method writes the address of the IMMDevice interface for the specified device. Through this method, the caller obtains a counted reference to the interface.
Returns
HREUSLT
RegisterEndpointNotificationCallback(IMMNotificationClient notificationClient)
Registers a client's notification callback interface.
RegisterEndpointNotificationCallbackNative(IMMNotificationClient notificationClient)
Registers a client's notification callback interface.
public Int32 RegisterEndpointNotificationCallbackNative(IMMNotificationClient notificationClient)
Parameters
notificationClient
IMMNotificationClientImplementation of the IMMNotificationClient which is should receive the notificaitons.
Returns
HRESULT
UnregisterEndpointNotificationCallback(IMMNotificationClient notificationClient)
Deletes the registration of a notification interface that the client registered in a previous call to the RegisterEndpointNotificationCallback method.
UnregisterEndpointNotificationCallbackNative(IMMNotificationClient notificationClient)
Deletes the registration of a notification interface that the client registered in a previous call to the RegisterEndpointNotificationCallback method.
public Int32 UnregisterEndpointNotificationCallbackNative(IMMNotificationClient notificationClient)
Parameters
notificationClient
IMMNotificationClientImplementation of the IMMNotificationClient which should be unregistered from any notifications.
Returns
HRESULT
Item
Gets the MMDevice with the specified device id.
public MMDevice Item { get; }
Parameters
deviceId
The device identifier.