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 change the volume 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
16-Aug-02
Category
Multimedia
Language
Delphi 3.x
Views
56
User Rating
No Votes
# Votes
0
Replies
0
Publisher:
DSP, Administrator
Reference URL:
DKB
			Author: Tomas Rutkauskas

How can I change the volume?

Answer:

1   procedure SetVolume(X: Word);
2   var
3     iErr: Integer;
4     i: integer;
5     a: TAuxCaps;
6   begin
7     for i := 0 to auxGetNumDevs do
8     begin
9       auxGetDevCaps(i, Addr(a), SizeOf(a));
10      if a.wTechnology = AUXCAPS_CDAUDIO then
11        break;
12    end;
13  
14    // Sets volume equally for left and right channels.
15    // VOLUME := LEFT * $10000 + RIGHT * 1 (or the other way? :)
16  
17    iErr := auxSetVolume(i, (X * $10001));
18    if (iErr = 0) then
19      ShowMessage('No audio devices are available!');
20  end;
21  
22  function GetVolume: Word;
23  var
24    iErr: Integer;
25    i: integer;
26    a: TAuxCaps;
27    vol: word;
28  begin
29    for i := 0 to auxGetNumDevs do
30    begin
31      auxGetDevCaps(i, Addr(a), SizeOf(a));
32      if a.wTechnology = AUXCAPS_CDAUDIO then
33        break;
34    end;
35    iErr := auxGetVolume(i, addr(vol));
36    GetVolume := vol;
37    if (iErr = 0) then
38      ShowMessage('No audio devices are available!');
39  end;


You'll have to modify AUXCAPS_CDAUDIO to whatever suits
(check out available values via the Ctrl+Space shortcut in Delphi 3)

			
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