Главная страница | назад





Article #21549: Code sample to detect if there is a sound device present on a computer.

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;
					

Last Modified: 05-FEB-02