Problems capturing audio from the second sound card
<p>I have written a program that captures sound via waveInOpen() in Wuindows. It works great on the michrophone-device on the main-board, but when I try to capture from the second sound-card, I get only [static] noise. Recording with SoundRecorder works great on both cards. Does any1 know if there are any known problems with waveInOpen() and multiple input-devices?</p>

<p>The code that opens the input-device looks like this:</p>

<pre><code>void Audio::OpenDevice(const int device,
        const Audio::SamplingRate samplingRate) 
        throw (Exception, std::exception)
{
 switch(samplingRate)
 {
...
 case AUDIO_16BIT_44KHZ_STEREO:
  bits_per_sample_ = 16;
  hertz_ = 44100;
  channels_ = 2;
  break;
...
 default:
  throw Exception("Audio::OpenDevice(): Invalid enum value");
 }

 // Open the device
 const UINT_PTR dev = (-1 == device) ? (UINT_PTR)WAVE_MAPPER : (UINT_PTR)device;
 WAVEFORMATEX wf = {0};
 wf.wFormatTag = WAVE_FORMAT_PCM;
 wf.nChannels = channels_;
 wf.wBitsPerSample = bits_per_sample_;
 wf.nSamplesPerSec = hertz_;
 wf.nBlockAlign = wf.nChannels * wf.wBitsPerSample / 8;
`
 const MMRESULT result = waveInOpen(&amp;hwi_, dev, &amp;wf, 
  (DWORD_PTR)OnWaveEvent, (DWORD_PTR)this, CALLBACK_FUNCTION);
 if (MMSYSERR_NOERROR != result)
  throw Exception("waveInOpen()");

 std::cout &lt;&lt; "Audio: Sampling at " &lt;&lt; hertz_ &lt;&lt; " hertz from " 
  &lt;&lt; channels_ &lt;&lt; " channel(s) with " &lt;&lt; bits_per_sample_
  &lt;&lt; " bits per sample. "
  &lt;&lt; std::endl;
}
</code></pre>
