From the Microsoft API doc: https://learn.microsoft.com/en-us/windows/win32/api/mmdeviceapi/ne-mmdeviceapi-erole
The ERole
enum
typedef enum __MIDL___MIDL_itf_mmdeviceapi_0000_0000_0002 {
eConsole,
eMultimedia,
eCommunications,
ERole_enum_count
} ERole;
defines a list of "roles" that audio endpoint devices choose to play
Constants
- eConsole Games, system notification sounds, and voice commands.
- eMultimedia Music, movies, narration, and live music recording.
- eCommunications Voice communications (talking to another person).
- ERole_enum_count The number of members in the ERole enumeration (not counting the ERole_enum_count member).
What I don't get from the doc page is:
- If a device is set to
eConsole
, will it be completely excluded from handling
Music, movies, narration, and live music recording, plus
Voice communications (talking to another person)
?
I don't believe the answer is yes, because the low-level hardware or the OS wouldn't know whether an audio stream is music or speech without user tagging. So what is this ERole
then? An audio mixing configuration that plays "well" (subjectively and statistically) with the target content types? A latency setting? or a combination of the two or more properties?
UPDATE
Thanks for @Roman R.'s answer. Now more questions still fitting the question title:
Doc of IMMDeviceEnumerator::GetDefaultAudioEndpoint
says:
HRESULT GetDefaultAudioEndpoint(
EDataFlow dataFlow,
ERole role,
IMMDevice **ppEndpoint
);
role
The role of the endpoint device. The caller should set this parameter to one of the following ERole enumeration values:
eConsole
eMultimedia
eCommunications
so only "ONE" role can be assigned; And since ERole_enum_count
is not a real option as in most enum custom protocols, how would one make sure "all of the roles
" be played by a single device, as mentioned in the Device Roles and your quote on that page?