Author: Tomas Rutkauskas
Detect whether there is a sound card installed
Answer:
Solve 1:
If you need to detect whether there is a sound card installed, your application may
call the function 'waveOutGetNumDevs' from the multimedia DLL (winmm.dll, part of a
standard installation).
1 // declare by a nicer functionname..2 3 function SoundCardInstalled: longint; stdcall;
4 external 'winmm.dll' name 'waveOutGetNumDevs';
5 6 // use like this..7 8 if SoundCardInstalled > 0 then9 Showmessage('A sound card was found.');
Solve 2:
Add MMSystem in the uses of your form
p
10 rocedure TForm1.Button1Click(Sender: TObject);
11 begin12 if waveOutGetNumDevs > 0 then13 ShowMessage('Hay tarjeta de sonido instalada' +
14 #13 +
15 'There is a soundcard installed')
16 else17 ShowMessage('No Hay tarjeta de sonido instalada' + #13 +
18 #13 +
19 'There is not a soundcard installed');
20 end;