使用 DirectShow 同时播放多个 wav 文件并录制它们 C++
我想创建一个示例应用程序,以便在 C++ 中同时播放多个 wav 文件。当文件开始播放时,我需要录制所有正在播放的 wav 文件的“声音、音频”。换句话说就是在演奏的过程中将它们混合起来。
我是 DirectX 新手,我不知道应该使用 DirectX 的哪个组件:
我刚刚检查了此链接:http://www.mycplus.com/tutorials/microsoft-direct-x-programming/directx-components/
我应该使用:
- DirectShow 播放多个 wav 文件
- 怎么样记录下来,我应该使用 DirectX 中的哪个组件?
如果有一个示例开源应用程序,我也想知道。当然,最好有一些示例源代码。
提前致谢。
I would like to create a sample application in order to play multiple wav files at the same time in C++. When a file started playing, I need to record the "sound, audio" of all of the wav files playing. In other words is to mix them during playing.
I am new with DirectX and I dont know which component of DirectX I should used for this:
I just have checked this link: http://www.mycplus.com/tutorials/microsoft-direct-x-programming/directx-components/
I should use:
- DirectShow to play multiple wav files
- How about record them, which component in DirectX, should I use?
If there is a sample open source application, I would like to know as well. It would be the best with some sample source code off course.
Thanks in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
首先,
DirectShow
不是DirectX
的一部分。相反,它是核心 Windows SDK 和组件的一部分(不要与“Direct-”前缀混淆)。Windows SDK 附带了一个很棒的工具:GraphEdit。 MSDN 上也对此进行了描述: 使用图形编辑。
您可以在此处构建多重播放图,而无需实际编程,并了解其工作原理的基本概念。您还可以在代码中执行相同的操作。
录音可能是一件比较棘手的事情,稍后您将解决这个问题。您将决定是使用压缩还是现在使用您喜欢的格式。对于简单的
PCM
.WAV
,您将需要一个额外的过滤器,该过滤器可作为 Windows SDK 或其早期版本的示例提供:WavDest 筛选器示例。Frist of all,
DirectShow
is not a part ofDirectX
. Instead, it is a part of core Windows SDK and components (don't be confused by "Direct-" prefix).Windows SDK comes with a great tool: GraphEdit. It is also described on MSDN: Using GraphEdit.
You can built multi-playback graph right there without actually programming and get a basic idea how things work. You will also be able to do the same in code.
Recording might be a trickier thing, and you will address this later. You will decide whether you are using compression or now, what format you prefer. For straightforward
PCM
.WAV
you will need an additional filter, which is available as a sample from Windows SDK, or its earlier version: WavDest Filter Sample.