编写音频源过滤器以用作Lync麦克风 [英] Write an audio source filter for use as Lync microphone
问题描述
我正在尝试编写DirectShow音频捕获过滤器,Microsoft Lync客户端可以将其识别为麦克风
源。这些是我已经采取的步骤:
-
过滤器源自
CSource
;其输出引脚源自CSourceStream
并实现IKsPropertySet
和IAMStreamConfig
以及所有必要的方法(包括IUnknown
方法) -
确保
AM_MEDIA_TYPE
及其WAVEFORMATEX
标头在GetStreamCaps()
和GetMediaType()
-
在
fillBuffer()
中,每个媒体样本都填充有正弦波测试序列 -
为COM服务器创建类工厂,并在
中导出DLL函数.def
文件,将过滤器注册到CLSID_AudioInputDeviceCategory
。
使用 regsvr32
注册我的过滤器后,当前所有内容都在GraphEdit中工作:该过滤器显示在音频捕获设备下,并且音调正确播放。
< hr>
但是,我在真实程序中得到了不同的结果。例如,在Picasa的网络摄像头测试仪中,过滤器显示为音频源,但切换到该源会使程序崩溃。
在所有版本的Lync客户端中,过滤器根本不会显示为麦克风
在音频设备->麦克风
。我已经阅读了
我需要灵活性用代码编写我自己的解决方案的方法,它的另一个好处是不需要购买许可证。
我是否需要切换到Windows Media Foundation,支持我的过滤器中的其他接口,将sou带有硬件扬声器源的rce过滤器等?
我需要采取什么步骤使过滤器显示为麦克风
的来源?
Lync(Skype for Business)没有使用DirectShow进行音频捕获,因此它看不到您的虚拟设备,也无法拾取它。据推测,它使用WASAPI。虚拟音频电缆大概实现了音频设备的内核级驱动程序,WASAPI可以通过用户模式API来获取和公开该驱动程序。无法将虚拟音频源连接到不使用DirectShow进行音频捕获的应用程序。
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?
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.
这篇关于编写音频源过滤器以用作Lync麦克风的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!