windows上有没有api可以调用呢?还是要写个驱动呢?求高手解说
XP上可能不支持这个热插拔事件。系统声卡可能不会告诉你这个事件。 我记得是Vista开始,系统才支持这种端点切换的。
HRESULT OnPropertyValueChanged( [in] LPCWSTR pwstrDeviceId, [in] const PROPERTYKEY key );
Parameters
pwstrDeviceId [in]
Pointer to the endpoint ID string that identifies the audio endpoint device. This parameter points to a null-terminated, wide-character string that contains the endpoint ID. The string remains valid for the duration of the call. key [in]
A PROPERTYKEY structure that specifies the property. The structure contains the property-set GUID and an index identifying a property within the set. The structure is passed by value. It remains valid for the duration of the call. For more information about PROPERTYKEY, see the Windows SDK documentation.
Return value
If the method succeeds, it returns S_OK. If it fails, it returns an error code. Remarks
A call to the IPropertyStore::SetValue method that successfully changes the value of a property of an audio endpoint device generates a call to OnPropertyValueChanged. For more information about IPropertyStore::SetValue, see the Windows SDK documentation.
A client can use the key parameter to retrieve the new property value. For a code example that uses a property key to retrieve a property value from the property store of an endpoint device, see Device Properties.
|