2

I've spent the last two weeks searching everywhere trying to get even so much as a hint on how to do this. This is my first time asking, and trust me when I say that I do not like to ask for help.

But I am at the end of my rope, all I can find is how to list available audio and video devices using someone else's Framework in C#. All I want to do is list the available audio and video devices connected to ones computer from within C# without any additional 3rd party Frameworks.

If any of you could help with this, I would greatly appreciate it. Like I said, I'm at the end of my rope trying to figure out how to do this.

Thanks!

VincePaltop
  • 23
  • 1
  • 3

3 Answers3

2

Try aForge.net http://www.aforgenet.com/ it is fairly simple doing exactly that, or you can use their ready made dialog if it is enough for you.

Leandro Bardelli
  • 10,561
  • 15
  • 79
  • 116
Itay Gal
  • 303
  • 2
  • 8
0

After Googling for "C# get video capture devices". I ended up at these two CodeProject articles:

You'll see that there is a lot of COM interop involved. And from the sound of it, I'm not sure you're ready to jump right into that, at it can be a lot of tedious work. I would consider using what is there, and not re-inventing the wheel. After all, they are both in the public domain.

Additionally, there is this post on StackOverflow which has some interesting links:

Community
  • 1
  • 1
Jonathon Reinhart
  • 132,704
  • 33
  • 254
  • 328
-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);
  • 2
    @jam: there's little to explain here. These are P/Invoke declarations for obsolete audio only API. It does not really answers original question. – Roman R. Oct 02 '13 at 11:12