我花了最近两周的时间在各地搜索,试图得到更多关于如何做到这一点的暗示。这是我第一次询问,当我说我不想寻求帮助时,请相信我。
但是我的绳索结束了,我能找到的是如何在C#中使用别人的框架列出可用的音频和视频设备。我想要做的就是在C#中列出连接到一台计算机的可用音频和视频设备,而无需任何额外的第三方框架。
如果您有任何人可以帮助解决这个问题,我将不胜感激。就像我说的那样,我正在试图弄清楚如何做到这一点。
谢谢!
答案 0 :(得分:1)
尝试aForge.net http://www.aforgenet.com/这样做非常简单,或者你可以使用他们现成的对话框,如果它足够了。
答案 1 :(得分:0)
在Google搜索"C# get video capture devices"之后。我最终得到了这两篇CodeProject文章:
你会发现涉及很多COM互操作。从它的声音来看,我不确定你是否准备好直接进入那个,因为这可能是一项繁琐的工作。我会考虑使用那里的东西,而不是重新发明轮子。毕竟,他们都在public domain。
此外,StackOverflow上有这篇文章有一些有趣的链接:
答案 2 :(得分:-2)
/// <summary>
/// The DirectSoundEnumerate function enumerates the DirectSound Odrivers installed in the system.
/// </summary>
/// <param name="lpDSEnumCallback">callback function</param>
/// <param name="lpContext">User context</param>
[DllImport("dsound.dll", EntryPoint = "DirectSoundEnumerateA", SetLastError = true, CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
static extern void DirectSoundEnumerate(DevicesEnumCallback lpDSEnumCallback, IntPtr lpContext);
/// <summary>
/// The DirectSoundEnumerate function enumerates the DirectSound Input drivers installed in the system.
/// </summary>
/// <param name="lpDSEnumCallback">callback function</param>
/// <param name="lpContext">User context</param>
[DllImport("dsound.dll", EntryPoint = "DirectSoundCaptureEnumerateA", SetLastError = true, CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
static extern void DirectSoundCaptureEnumerate(DevicesEnumCallback lpDSEnumCallback, IntPtr lpContext);