title: Windows shell: How can I get the audio device(s) name(s)?
body: <blockquote>
    <p>I am not sure if this is strictly a programming question, as long as I
    don't mind to use additional software in order to solve the problem, as long as it keeps being scriptable or command-line (this is: a not GUI solution). Anyway, I have posted another (a bit different) question at <a href="https://superuser.com/questions/922008/windows-command-line-method-to-know-the-name-of-my-audio-recording-device">SuperUser</a>. By the way, I will update here if I get the answer there.</p>
  </blockquote>
  
  <p>My Windows program (just a shell script) <strong>invokes VLC command-line</strong> in order to <strong>record audio</strong> from the audio card and stream it out, like:</p>
  
  <pre><code>vlc dshow:// :dshow-vdev=none :dshow-adev="SoundMAX HD Audio I" :std{mux=ts,access=http,dst=:8080} :sout-keep [rest of the cmdline not relevant]
  </code></pre>
  
  <p>As long as there could be <strong>multiple audio devices</strong> on a computer (webcam, multiple audio cards, bluettoth devices... etc), I need to programmatically get the <strong>name</strong> of them.</p>
  
  <p>I have used FFMPEG until now:</p>
  
  <pre><code>ffmpeg -list_devices true -f dshow -i dummy
  </code></pre>
  
  <p>... but sometimes it does not work OK, for example:</p>
  
  <pre><code>d:\Utils\FFMPEG\bin&gt;ffmpeg -list_devices true -f dshow -i dummy
  ffmpeg version N-72460-g11aa050 Copyright (c) 2000-2015 the FFmpeg developers
    built with gcc 4.9.2 (GCC)  configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libdcadec --enable-libfreetype --enable-libgme --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmfx --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --ena
  ble-librtmp --enable-libschroedinger --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-lzma --enable-decklink --enable-zlib
    libavutil      54. 26.100 / 54. 26.100
    libavcodec     56. 41.100 / 56. 41.100
    libavformat    56. 34.100 / 56. 34.100
    libavdevice    56.  4.100 / 56.  4.100
    libavfilter     5. 16.101 /  5. 16.101
    libswscale      3.  1.101 /  3.  1.101
    libswresample   1.  1.100 /  1.  1.100
    libpostproc    53.  3.100 / 53.  3.100
  [dshow @ 0000000000363520] DirectShow video devices (some may be both video and
  audio devices)
  [dshow @ 0000000000363520] Could not enumerate video devices (or none found).
  [dshow @ 0000000000363520] DirectShow audio devices
  [dshow @ 0000000000363520] Could not enumerate audio only devices (or none found
  ).
  dummy: Immediate exit requested
  </code></pre>
  
  <p>The command line tool <code>SystemInfo</code> does neither work:</p>
  
  <pre><code>C:\&gt;systeminfo | find "audio" /i
  
  C:\&gt;
  </code></pre>
  
  <p>Searching inside <code>regedit</code> found nothing about my soundcard example (<code>SoundMAX HD Audio I</code>).</p>
  
  <p>Isn't there any other more reliable way to programmatically <strong>obtain the sound device(s)</strong> name(s)?</p>
  
  <p>If possible, I would prefer to obtain answers for both Windows XP and Vista or later.</p>
  
  <p>Additional <strong>tests</strong> performed:  </p>
  
  <ul>
  <li>Installed latest MicroSoft .NET FrameWork v4.5.2 &amp; rebooted.</li>
  <li>Tested older versions of FFMPEG: v4.8 (2014) and v4.7 (2013).</li>
  <li>Tested UAC elevated prompt.</li>
  </ul>