Click here to Skip to main content
15,889,281 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
Is there a way to programmatically specify which speakers is a full-range speaker? I get get the property of the PKEY_AudioEndpoint_FullRangeSpeakers using the following code:

C++
IPropertyStore *pStore;
hr = pDevice->OpenPropertyStore(STGM_READ, &pStore);
if (SUCCEEDED(hr))
{
	LPWSTR pwszID = NULL;
    
	PROPVARIANT varName;
	PropVariantInit(&varName);

	PROPVARIANT eventDriven;
	PropVariantInit(&eventDriven);

	PROPVARIANT speakerMask;
	PropVariantInit(&speakerMask);

	if (SUCCEEDED(pStore->GetValue(PKEY_Device_FriendlyName, &varName)) &&
	SUCCEEDED(pStore->GetValue(PKEY_AudioEndpoint_Supports_EventDriven_Mode, &eventDriven)) &&
	SUCCEEDED(pDevice->GetId(&pwszID)))
	{
		//pStore->GetValue(PKEY_AudioEndpoint_PhysicalSpeakers, &speakerMask);
		pStore->GetValue(PKEY_AudioEndpoint_FullRangeSpeakers, &speakerMask);
	}
...


But the property is read-only and I can't use SetValue() to set the key.
Does anyone know how to set this property?
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900