如何检查捕获设备上是否有可用的音频 [英] How do I check if there is audio available on capture devices

查看:76
本文介绍了如何检查捕获设备上是否有可用的音频的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个应用程序,该应用程序应该确定音频捕获设备上是否有音频可用于电脑上。



我创建了一个所有可用音频设备的列表。设备的显示是通过使用dshownetlib完成的。用户可以选择某个音频设备。



现在我想知道是否有音频播放所有这些设备。特别是如果有声音可以向用户发送通知就足够了。我一直在使用naudio来解决这个问题,但到目前为止还没有成功。



有什么想法吗?

I'm developing an application which should determine if there is audio available on audio capture devices which are on or connected to the pc.

I do create a list of all audio devices which are available. The showing of devices is done by using dshownetlib.So the user is able to select a certain audio device.

Now I want to figure out if there is audio playing on all of these devices. In particular sending a notice to the user if there is sound available is just enough. I've been using naudio to get this up and working, but didn't succeeded so far.

Any idea?

推荐答案

找到了解决我自己问题的方法。



使用naudio.dll我检查WaveInEventArgs.buffer中的每个项目是否发送到data_available的处理程序。



缓冲区中的每个项目都会检查其Int值。确定有价值/可用样品的数量,我们可以检查是否有声音。



至少,它对我有效。
Found myself a solution for my own problem.

Using the naudio.dll I check each item in the WaveInEventArgs.buffer which is send to the handler of the data_available.

Each item in the buffer is checked on its Int value. Determining the amount of valuable/usable samples we can check whether there is sound or not.

At least, it is working for me.

这篇关于如何检查捕获设备上是否有可用的音频的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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