<p>How do I detect if the system has a default recording device installed?
I bet this can be done through some calls to the Win32 API, anyone has any experience with this?</p>

<p>I'm talking about doing this through code, not by opening the control panel and taking a look under sound options.</p>

[{'answer_id': 41346, 'author': 'Espo', 'author_id': 2257, 'author_profile': 'https://Stackoverflow.com/users/2257', 'pm_score': 0, 'selected': False, 'text': '<p>There is an Open Source Audio API called <a href="http://www.portaudio.com/" rel="nofollow noreferrer">PortAudio</a> that has a method you could use. I think the method is called Pa_GetDeviceInfo() or something.</p>\n'}, {'answer_id': 41385, 'author': 'Jeff Hillman', 'author_id': 3950, 'author_profile': 'https://Stackoverflow.com/users/3950', 'pm_score': 2, 'selected': True, 'text': '<p>Using the <a href="https://www.microsoft.com/en-in/download/details.aspx?id=6812" rel="nofollow noreferrer">DirectX SDK</a>, you can call DirectSoundCaptureEnumerate, which will call your DSEnumCallback function for each DirectSoundCapture device on the system.  The first parameter passed to your DSEnumCallback is an LPGUID, which is the "Address of the GUID that identifies the device being enumerated, or NULL for the primary device".</p>\n\n<p>If all you need to do is find out if a recording device is present (I don\'t think this is good enough if you really need to know the default device), you can use waveInGetNumDevs:</p>\n\n<pre><code>#include &lt;tchar.h&gt;\n#include &lt;windows.h&gt;\n#include "mmsystem.h"\n\nint _tmain( int argc, wchar_t *argv[] )\n{\n    UINT deviceCount = waveInGetNumDevs();\n\n    if ( deviceCount &gt; 0 )\n    {\n        for ( int i = 0; i &lt; deviceCount; i++ )\n        {\n            WAVEINCAPSW waveInCaps;\n\n            waveInGetDevCapsW( i, &amp;waveInCaps, sizeof( WAVEINCAPS ) );\n\n            // do some stuff with waveInCaps...\n        }\n    }\n\n    return 0;\n}\n</code></pre>\n'}, {'answer_id': 47702, 'author': 'Lars Truijens', 'author_id': 1242, 'author_profile': 'https://Stackoverflow.com/users/1242', 'pm_score': 0, 'selected': False, 'text': '<p>The win32 api has a function called <a href="http://msdn.microsoft.com/en-us/library/ms713732(VS.85).aspx" rel="nofollow noreferrer">waveInGetNumDevs</a> for it.</p>\n'}]
['https://Stackoverflow.com/questions/41330', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1509946/']