我如何捕获/重定向由以下人员产生的声音:
Console.Beep(400, 1000);
要么到某个字节缓冲区,要么直接到一个 wav 文件都可以。
我搜索过,但只找到了重定向文本输出的方法,而不是声音。
最佳答案
您将无法重定向提示音。
Console.Beep()
通过调用 Windows API Beep() function
实现如果可以,它会调用声卡硬件。
您有多种选择:
- 你可以使用 DirectShow's Audio Capture as described here .
- 你可以使用 an audio capture program such as described here .
- 你可以写成a program to generate a wav file as described here .
我认为最后一个是你最好的选择。
关于c# - 重定向 Console.Beep,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16895873/