How do I inject custom audio buffers into a DirectX filter graph using DSPACK?

时光怂恿深爱的人放手 提交于 2019-12-07 12:09:00

问题


I am using Delphi 6 with DSPACK to do several operations involving audio and DirectX. I have the "input" side figured out where I assign one of the enumerated audio input devices to a TFilter object and connect that filter to a TSampleGrabber object and that gives me the audio buffers I need to send audio to Skype. It is the logical inverse of that graph that I need to figure out. I receive audio buffers from Skype via a socket. I need to create a graph that has a filter that would be the complement to TSampleGrabber. In other words, a TFilter that instead of delivering audio buffers during an event that fires when new audio is available like TSampleGrabber does, would have a similar event that fires when new audio is necessary to feed the graph. At the tail end of this "output" graph would be a TFilter assigned to one of the enumerated audio output devices whose input pins would connect to the output pins of this TSampleGrabber inverse doppelganger.

Does anyone know how to do this? I of course would prefer to avoid writing a custom filter COM object of my own to get this done. I'm hoping that there is an existing TFilter that accepts custom audio buffers to be mixed into a DirectX filter graph.


回答1:


A common starting point for a data injection filter is Push Source Filters Sample. This creates a filter with output only pin, which injects data into DirectShow pipeline, data can be of any type and typically it is video or audio.

As you mentioned Delphi and DSPack, the latter has this sample ported (see \Demos\D6-D7\Filters\PushSource).



来源:https://stackoverflow.com/questions/7630329/how-do-i-inject-custom-audio-buffers-into-a-directx-filter-graph-using-dspack

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!