Partager via


Device Roles

Previous Next

Device Roles

  • Note   The MMDevice API supports device roles. However, the user interface in Windows Vista does not implement support for this feature. User interface support for device roles might be implemented in a future version of Windows. For more information, see Device Roles in Windows Vista.

If a system contains two or more audio-rendering endpoint devices, then one device might be best for playing one type of audio content, and another device might be best for playing another type of content. For example, if a system has two rendering devices, the user might choose to play music on one device and to play system notification sounds on the other.

Similarly, if a system contains two or more audio-capture endpoint devices, then one device might be best for capturing one type of audio content, and another device might be best for capturing another type of content. For example, if a system has two capture devices, the user might choose to record live music on one device and to use the other device for voice commands.

The ERole enumeration defines the device roles that are supported by the MMDevice API. The following table describes the device roles identified by the three constants—eConsole, eCommunications, and eMultimedia—in the ERole enumeration.

ERole constant Device role Rendering examples Capture examples
eConsole Interaction with the computer Games and system notifications Voice commands
eCommunications Voice communications with another person Chat and VoIP Chat and VoIP
eMultimedia Playing or recording audio content Music and movies Narration and live music recording

A particular rendering or capture device might be assigned none, one, some, or all of the roles in the preceding table. At any time, each role in the table is assigned to one (and only one) rendering device and to one (and only one) capture device. That is, the assignment of roles to rendering devices is independent of the assignment of roles to capture devices.

An application might choose to play all of its output streams through a single rendering endpoint device, and to record all of its input streams from a single capture endpoint device. Alternatively, an application might choose to play some of its output streams through one rendering device and to play other output streams through another rendering device. Similarly, it might choose to record some of its input streams through one capture device and to record other input streams through another capture device. In all cases, the application can assign each stream to the device whose role is most appropriate for that stream.

For example, a VoIP application might assign the output stream that contains the ring-in notification to the rendering endpoint device with the eConsole role. In addition, the application might assign its voice input and output streams to the capture and rendering endpoint devices with the eCommunications role.

A client can register itself to receive a notification from the MMDevice API each time a change occurs in the assignment of roles to audio endpoint devices. When a role shifts from one device to another, the client can choose whether to continue playing (or recording) its streams through the same device or to switch the streams to another device. By default, the streams continue to play (or be recorded) through the original device. To switch the streams to another device, the client must delete the streams on the original device and create replacement streams on the new device.

Applications cannot change the roles that are assigned to audio endpoint devices. The operating system allows only the user to assign device roles.

Previous Next