编写音频源过滤器以用作Lync麦克风 [英] Write an audio source filter for use as Lync microphone

查看:177
本文介绍了编写音频源过滤器以用作Lync麦克风的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试编写DirectShow音频捕获过滤器,Microsoft Lync客户端可以将其识别为麦克风源。这些是我已经采取的步骤:


  1. 过滤器源自 CSource ;其输出引脚源自 CSourceStream 并实现 IKsPropertySet IAMStreamConfig 以及所有必要的方法(包括 IUnknown 方法)


  2. 确保 AM_MEDIA_TYPE 及其 WAVEFORMATEX 标头在 GetStreamCaps() GetMediaType()


  3. fillBuffer()中,每个媒体样本都填充有正弦波测试序列


  4. 为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:

  1. Filter derives from CSource; its output pin derives from CSourceStream and implements IKsPropertySet and IAMStreamConfig and all necessary methods (inc. IUnknown methods)

  2. Ensure that the appropriate metadata for the AM_MEDIA_TYPE and its WAVEFORMATEX header are set in GetStreamCaps() and GetMediaType()

  3. In fillBuffer(), each media sample is filled with a sine wave test sequence

  4. Created the class factory for the COM server and exported DLL functions in a .def file, registering the filter under CLSID_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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆