如何捕获波形输出PCM数据 [英] How to capture PCM data from Wave Out

查看:658
本文介绍了如何捕获波形输出PCM数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何将有可能以编程方式捕获音频?我实现,在实时流在网络上的桌面的应用程序。视频部分已完成。我需要实现音频部分。我需要一种方法来从声卡得到PCM数据喂到我的EN codeR(实现使用Windows Media格式)。

How would it be possible to capture the audio programmatically? I am implementing an application that streams in real time the desktop on the network. The video part is finished. I need to implement the audio part. I need a way to get PCM data from the sound card to feed to my encoder (implemented using Windows Media Format).

我认为答案是关系到openMixer(),waveInOpen()在Win32 API函数,但我不知道到底该怎么办。

I think the answer is related to the openMixer(), waveInOpen() functions in Win32 API, but I am not sure exactly what should I do.

如何打开必要的渠道和如何从中读取PCM数据?

How to open the necessary channel and how to read PCM data from it?

先谢谢了。

推荐答案

我不认为这是一个直接的方式做到这一点使用的操作系统 - 这是一个功能,该功能可能(也可能不会)是present上声卡。有些声卡有一个loopback接口 - 创意称之为什么ü听到的声音。您只需选择这个作为使用正常waveInOpen()输入,而不是麦克风,并记录从中,你已经知道了。

I don't think there is a direct way to do this using the OS - it's a feature that may (or may not) be present on the sound card. Some sound cards have a loopback interface - Creative calls it "What U Hear". You simply select this as the input rather than the microphone, and record from it using the normal waveInOpen() that you already know about.

如果声卡没有这种功能,那么我想你了不是做一些疯狂的喜欢做自己的驱动程序等运气。或者你可以说服你的用户运行从扬声器输出电缆线路输入:)

If the sound card doesn't have this feature then I think you're out of luck other than by doing something crazy like making your own driver. Or you could convince your users to run a cable from the speaker output to the line input :)

这篇关于如何捕获波形输出PCM数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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