静音时的CSCore回送记录 [英] CSCore loopback recording when muted

查看:168
本文介绍了静音时的CSCore回送记录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用CSCore.WasapiLoopbackCapture录制系统声音.但是,当系统中没有声音时,它根本不会录音!例如,在播放音乐和录制音乐时,输出文件的持续时间小于曲目的持续时间.我希望它即使在系统中没有声音的情况下也能继续录制,但是我没有找到任何可控制此行为的属性.这是我的代码段:

I'm using CSCore.WasapiLoopbackCapture to record system sound. But when there is no sound in system, it doesn't record at all! For instance, while playing music and recording it, the output file's duration is less than the track's. I want it to continue recording even when there is no sound in the system but I didn't find any property to control this behavior. Here is my code snippet:

WasapiCapture waveLoop = new WasapiLoopbackCapture();
waveLoop.Initialize();
waveLoop.DataAvailable += waveLoop_DataAvailable;
waveLoop.Stopped += waveLoop_Stopped;
waveLoop.Start();

推荐答案

您的问题"没有不错"的解决方案.但是您的问题已经得到描述

There is no "nice" solution for your "problem". But your problem already got described here:

另一个奇怪的是,WASAPI仅在有活动流时才将数据向下推送到渲染端点.当什么都没有播放时,什么都没有捕捉.

Another oddity is that WASAPI will only push data down to the render endpoint when there are active streams. When nothing is playing, there is nothing to capture.

这意味着您无法针对这种行为采取任何措施.如果没有播放任何内容,则不会捕获任何内容.最简单的解决方案是:

That means that there is nothing you can do against that behavior. If there is nothing playing, nothing will be captured. The easiest solution is:

但是我最喜欢的处理此问题的方法是运行silence.exe.这样一来,就不会有任何无所事事"的小故障,因为总有东西在玩.

But my particular favorite way of handling this is to run silence.exe. That way there are never any "nothing is playing" glitches, because there's always something playing.

因此,只需确保您的应用程序或任何其他应用程序处于静音状态即可.那将是确保您的应用程序记录静音而不是中断捕获的一种方法.

So just make sure your application or any other application plays silence. That would be a way to make sure that your application records silence instead of interrupting the capture.

这篇关于静音时的CSCore回送记录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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