Articles   Members Online:
-Article/Tip Search
-News Group Search over 21 Million news group articles.
-Delphi/Pascal
-CBuilder/C++
-C#Builder/C#
-JBuilder/Java
-Kylix
Member Area
-Home
-Account Center
-Top 10 NEW!!
-Submit Article/Tip
-Forums Upgraded!!
-My Articles
-Edit Information
-Login/Logout
-Become a Member
-Why sign up!
-Newsletter
-Chat Online!
-Indexes NEW!!
Employment
-Build your resume
-Find a job
-Post a job
-Resume Search
Contacts
-Contacts
-Feedbacks
-Link to us
-Privacy/Disclaimer
Embarcadero
Visit Embarcadero
Embarcadero Community
JEDI
Links
How to detect a sound device Turn on/off line numbers in source code. Switch to Orginial background IDE or DSP color Comment or reply to this aritlce/tip for discussion. Bookmark this article to my favorite article(s). Print this article
30-Aug-02
Category
Multimedia
Language
Delphi 2.x
Views
84
User Rating
No Votes
# Votes
0
Replies
0
Publisher:
DSP, Administrator
Reference URL:
DKB
			Author: Tomas Rutkauskas

Is there a way to detect a sound device (personally, I want to detect a sound card) 
to know if such a device is present on the computer my application is running?

Answer:

Solve 1:

1   { ... }
2   if WaveOutGetNumDevs > 0 then
3     ShowMessage('Wave-Device present')
4   else
5     ShowMessage('No Wave-Device present');
6   { ... }



Solve 2:

7   function IsSoundCardInstalled: Boolean;
8   type
9     SCFunc = function: UInt; stdcall;
10  var
11    LibInst: LongInt;
12    EntryPoint: SCFunc;
13  begin
14    Result := False;
15    LibInst := LoadLibrary(PChar('winmm.dll'));
16    try
17      if LibInst <> 0 then
18      begin
19        EntryPoint := GetProcAddress(LibInst, 'waveOutGetNumDevs');
20        if (EntryPoint <> 0) then
21          Result := True;
22      end;
23    finally
24      if (LibInst <> 0) then
25        FreeLibrary(LibInst);
26    end;

end;

			
Vote: How useful do you find this Article/Tip?
Bad Excellent
1 2 3 4 5 6 7 8 9 10

 

Advertisement
Share this page
Advertisement
Download from Google

Copyright © Mendozi Enterprises LLC