问题
I'm trying to write a DirectShow Audio Capture Filter that can be recognized by the Microsoft Lync client as a Microphone
source. These are the steps I've already taken:
Filter derives from
CSource
; its output pin derives fromCSourceStream
and implementsIKsPropertySet
andIAMStreamConfig
and all necessary methods (inc.IUnknown
methods)Ensure that the appropriate metadata for the
AM_MEDIA_TYPE
and itsWAVEFORMATEX
header are set inGetStreamCaps()
andGetMediaType()
In
fillBuffer()
, each media sample is filled with a sine wave test sequenceCreated the class factory for the COM server and exported DLL functions in a
.def
file, registering the filter underCLSID_AudioInputDeviceCategory
.
After registering my filter using regsvr32
, everything currently works in GraphEdit: the filter displays under Audio Capture Devices, and the tone plays correctly.
However, I get different results in "real" programs. In Picasa's webcam tester, for example, the filter displays as an audio source but switching to it crashes the program.
In all versions of the Lync client, the filter doesn't display at all as a Microphone
choice under Audio Device -> Microphone
. I've read in the Lync documentation that only virtual audio devices with a physical speaker and microphone are returned.
After looking around some more, it seems that Virtual Audio Cable produces the desired effect of being recognized by the system, as shown below:
I require the flexibility of writing my own solution code-wise, which has the added benefit of not needing to purchase a license.
Do I need to switch to Windows Media Foundation, support additional interfaces in my filter, couple the source filter with a hardware speaker source, etc.?
What steps do I need to take to make my filter appear as a Microphone
source?
回答1:
Lync (Skype for Business) does not use DirectShow for audio capture, so it does not see your virtual device and cannot pick it up. Presumably, it uses WASAPI. Virtual Audio Cable presumably implements a kernel level driver for audio device, which WASAPI picks up and exposes via user mode API. There is no way to connect your virtual audio source to application that does not use DirectShow for audio capture.
来源:https://stackoverflow.com/questions/31706844/write-an-audio-source-filter-for-use-as-lync-microphone