Announcement

Collapse
No announcement yet.

Detecting and selecting from Multiple Sound cards programmically

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Detecting and selecting from Multiple Sound cards programmically

    How does one detect the sound card(s) on a pc and select which one to use, if multiple ones exist? I've searched here and the API without luck.
    Barry

  • #2
    waveOutGetNumDevs returns the number of sound devices, waveOutGetDevCaps retrieves the capabilities and waveOutOpen opens a device for playback.

    For recording, use waveInGetNumDevs, waveInGetDevCaps and waveInOpen.

    This snippet enuemrates the names of sound output devices:

    Code:
       LOCAL hr AS LONG
       LOCAL i AS LONG
       LOCAL woc AS WAVEOUTCAPS
       
       FOR i = 0 TO waveOutGetNumDevs - 1
          hr = waveOutGetDevCaps(i, woc, SIZEOF(woc))
          ? woc.szPname
       NEXT
    Forum: http://www.jose.it-berater.org/smfforum/index.php

    Comment


    • #3
      I notice that my laptop reports the Windows Mixer and the sound card when Audacity prefs is used, but this routine only shows the sound card.

      I am also trying to find what playback device is in use and how to do that. As far as setting it, it sure looks like that is almost impossible as microsoft states this is a hidden api that moves around in OS's and users code can't follow without reverse engineering and using new code for each OS it is used on or version updates.
      Barry

      Comment

      Working...
      X