title: Selecting device (soundcard) to playsound on Delphi
body: <p>How can I select the soundcard to play my sound if I have a PC with two 
  soundcards.
  now I´m using:</p>
  
  <pre><code>procedure TForm_Principal.FormCreate(Sender: TObject);
  var
   DevOutCaps: TWaveOutCaps;
   n, i:Integer;
   s: String; 
  begin
   Self.comboOut.Items.Clear;
  
   n := waveOutGetNumDevs;
   for i := 0 to n-1 do
   begin
     waveOutGetDevCaps(i, @DevOutCaps, SizeOf(DevOutCaps));
     s := PChar(@DevOutCaps.szPname);
     Self.comboOut.Items.Add(s);
   end;
  end;
  </code></pre>
  
  <p>And then:</p>
  
  <pre><code>procedure TForm_Principal.Button1Click(Sender: TObject);
  var
    Res: TResourceStream;
  begin
    Res := TResourceStream.Create(HInstance, 'Sound_Ringing', RT_RCDATA);
    try
      Res.Position := 0;   
      PlaySound(Res.Memory,
      Self.comboOut.ItemIndex, SND_MEMORY or SND_ASYNC );
      //SndPlaySound(Res.Memory, SND_MEMORY or SND_ASYNC or SND_LOOP);
    finally
      Res.Free;
    end;
  end;
  </code></pre>
  
  <p>And it doesn't work, anyone can help me?
  Thank you.</p>