(DirectX系列04)DirectShow 音频录制

    在DirectX的Bin目录下有一个很好的工具-GraphEdit,通过这个工具能够很好的反映音频录制的过程。可以总结一点,DirectShow音频的录制过程就是,枚举、绑定、连接这三个步骤。接下来看看这三个步骤是如何实现的呢?

    在此之前,先来介绍下几个涉及到的COM对象。

    ICaptureGraphBuilder2

     IBaseFilter

    The IBaseFilter interface is the primary interface for DirectShow filters. All DirectShow filters must expose this interface. The Filter Graph Manager uses this interface to control filters. Applications can use this interface to enumerate pins and query for filter information, but should not use it to change the state of a filter. Instead, use the IMediaControl interface on the Filter Graph Manager.

    Filter developers: Implement this interface on every DirectShow filter. The CBaseFilter base class implements this interface.

 

    The ICaptureGraphBuilder2 interface builds capture graphs and other custom filter graphs. The Capture Graph Builder object implements this interface.

    在这里主要用于获取捕获链表的管理接口,通过这个接口可以对创建的IGraphBuilder进行绑定和管理。

     IGraphBuilder

     The IGraphBuilder interface allows applications to call upon the filter graph manager to attempt to build a complete filter graph, or parts of a filter graph given only partial information, such as the name of a file or the interfaces of two separate pins. The filter mapper looks up filters in the registry to configure the filter graph in a meaningful way.

 

   IGraphBuilder inherits from the IFilterGraph interface and exposes all its methods. For this reason, IFilterGraph should normally not be used directly.

     通常可以通过IGraphBuilder这个COM对象,我们获取滤波器链表接口,对构建的Graph进行管理。

     IMediaControl

     The IMediaControl interface provides methods for controlling the flow of data through the filter graph. It includes methods for running, pausing, and stopping the graph. The Filter Graph Manager implements this interface. For more information on filter graph states, see Data Flow in the Filter Graph.

   IMoniker

      Enables you to use a moniker object, which contains information that uniquely identifies a COM object. An object that has a pointer to the moniker object's IMoniker interface can locate, activate, and get access to the identified object without having any other specific information on where the object is actually located in a distributed system.

     Monikers are used as the basis for linking in COM. A linked object contains a moniker that identifies its source. When the user activates the linked object to edit it, the moniker is bound; this loads the link source into memory.

 

接下来看看实现代码,其中有相关的注释,清晰明了。

 

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值