如何使用 DirectShow.NET C# 访问音频流
我想做的是将任意音频文件传递到 DirectShow 过滤器,并最终使用 .NET 3.5 C# 和 DirectShow.NET 接收(PCM 音频)流对象。 我想说的是:
Stream OpenFile(string filename) {...}
我
stream.Read(...)
已经阅读 DirectShow 好几天了,我想我已经开始掌握过滤器和过滤图的概念了。 我找到了示例(到文件 / 到设备)如何播放音频或将其写入文件,但似乎无法找到 Stream 对象的解决方案。 这可能吗? 如果我错过了什么,你能给我指出正确的方向吗?
最好的,
豪克
What I would like to do is to pass an arbitrary audio file to a DirectShow filtergraph and receive a (PCM audio) stream object in the end using .NET 3.5 C# and DirectShow.NET. I would like to reach the point that I can just say:
Stream OpenFile(string filename) {...}
and
stream.Read(...)
I have been reading up on DirectShow for a couple of days and think I have started to grasp the idea of filters and filtergraphs. I found examples (to file / to device) how to play audio or write it to a file, but cannot seem to find the solution for a Stream object. Is this even possible? Could you point me in the right direction in case I missed something, please?
Best,
Hauke
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我想与您分享我对自己问题的解决方案(我的重点是异国情调的 bwf 文件格式。因此得名。):
I would like to share my solution to my own problem with you (my focus was on the exotic bwf file format. hence the name.):
这(AVILibrary Wrapper)可能会引导您找到解决方案,但它不是基于 DirectSound(我感觉它非常偏向于将代码与播放硬件连接起来),但可能是答案。
另一种方法可以在此处找到。
This (AVILibrary Wrapper) may lead you to a solution, it's not DirectSound based (which I get the feeling is very much biased to interfacing your code with the playback hardware) but could be the answer.
Another approach can be found here.
NAudio 怎么样? http://www.codeplex.com/naudio
它有一个流实现。
How about NAudio ? http://www.codeplex.com/naudio
It has a stream implementation.