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 Enable and disable sound from your application 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
06-Jan-03
Category
Multimedia
Language
Delphi All Versions
Views
101
User Rating
No Votes
# Votes
0
Replies
0
Publisher:
DSP, Administrator
Reference URL:
DKB
			Author: Christian Cristofori

Ever needed to completely disable and then re-enable audio capabilities from your 
application? There's the way to simple do it.

Answer:

1   unit AudioCtrl;
2   
3   interface
4   
5   procedure EnableAudio;
6   procedure DisableAudio;
7   
8   implementation
9   
10  uses
11    MMSystem;
12  
13  var
14    MyVolume: array[0..10] of LongInt;
15    mDevs: Integer;
16  
17  procedure EnableAudio;
18  var
19    I: Integer;
20  begin
21    for I := 0 to mDevs do
22    begin
23      auxSetVolume(I, MyVolume[I]);
24    end;
25  end;
26  
27  procedure DisableAudio;
28  var
29    I: Integer;
30  begin
31    mDevs := auxGetNumDevs;
32    for I := 0 to mDevs do
33    begin
34      auxGetVolume(I, Addr(MyVolume[I]));
35      auxSetVolume(I, LongInt(9000) * 65536 + LongInt(9000));
36    end;
37  end;
38  
39  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