Code sample to detect if there is a sound device present on a computer.

By: Kendall Sullivan

Abstract: This code sample detects whether a sound device is present on the computer were your application is running.

Question:
How can I detect if a sound device is present on the computer were my application is running?
Answer:
Use this code sample to detect if there is a sound device on the machine your application is running on. Make sure you add the unit MMSystem to your uses clause.

procedure TForm1.Button1Click(Sender: TObject);
begin
  if waveOutGetNumDevs > 0 then
    ShowMessage( 'Wave-Device present' )
  else
    ShowMessage( 'No Wave-Device present' );
end;
					

				    
				    

Server Response from: ETNASC01