捕获窗口的在C#中的音频 [英] Capturing Window's audio in C#

查看:116
本文介绍了捕获窗口的在C#中的音频的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有可能记录窗口的输出在C#编程的声音?像记录从你所听到的或立体声输出功能的东西(而不必选择它们)的位?

Is it possible to record Window's output sounds programmatically in C#? A bit like recording something from the "what you hear" or "stereo output" feature (without having to select them)?

推荐答案

这就是所谓的回环记录,它的的可能在Windows中。如果您有支持环回声卡(我只是检查了我的低端东芝笔记本电脑,它不),你可以直接从回环设备使用记录 waveInOpen 等API,这是很容易在C#中使用。注意:在这种方式记录音频必然需要在质量的降低,因为该音频信号转换为模拟输出,然后重新数字化,以支持回环接口

This is called loopback recording, and it is possible in Windows. If you have a soundcard that supports loopback (I just checked on my low-end Toshiba laptop, and it doesn't) you can record straight from the loopback device using the waveInOpen etc. API, which is easy to use in C#. Note: recording audio in this way necessarily entails a reduction in quality, since the audio signal is converted to analog for output and then re-digitized to support the loopback interface.

如果你没有声卡,WASAPI会让你做到这一点。我想WASAPI可以用C#中使用,但它看起来痛苦的。

If you don't have a soundcard, WASAPI will let you do this. I suppose WASAPI can be used with C#, but it looks painful.

这篇关于捕获窗口的在C#中的音频的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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