🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.multimedia
Article #1186

Re: how to change mic volume?

#1186
From: Charles Hacker
Date: Sat, 01 Sep 2001 06:18
53 lines
2532 bytes
Kalimity Jane wrote:
> 
> how can I change microphone volume?

uses mmsystem;

function GetWaveVolume: DWord;
var
  Woc : TWAVEOUTCAPS;
  Volume : DWord;
begin
  if WaveOutGetDevCaps(WAVE_MAPPER, @Woc, sizeof(Woc)) =
MMSYSERR_NOERROR then
    if Woc.dwSupport and WAVECAPS_VOLUME = WAVECAPS_VOLUME then
    begin
      WaveOutGetVolume(WAVE_MAPPER, @Volume);
      Result := Volume;
    end;
end;

procedure SetWaveVolume(const AVolume: DWord);
var
  Woc : TWAVEOUTCAPS;
begin
  if WaveOutGetDevCaps(WAVE_MAPPER, @Woc, sizeof(Woc)) =
MMSYSERR_NOERROR then
    if Woc.dwSupport and WAVECAPS_VOLUME = WAVECAPS_VOLUME then
      WaveOutSetVolume(WAVE_MAPPER, AVolume);
end;

Here's how they might be used:

procedure TForm1.Button2Click(Sender: TObject);
var
  LeftVolume: Word;
  RightVolume: Word;
begin
  LeftVolume := StrToInt(Edit1.Text);
  RightVolume := StrToInt(Edit2.Text);
  SetWaveVolume(MakeLong(LeftVolume, RightVolume));
end;

procedure TForm1.Button3Click(Sender: TObject);
begin
  Caption := IntToStr(GetWaveVolume);
end;

-- 
Charles Hacker
Lecturer in Electronics and Computing
School of Engineering
Griffith University - Gold Coast
Australia
Technical Details
Message-ID: <3B907DBF.5CC168DD@borland.newsgroups>
Path: arc1-ca.pugleaf.net!archiver1.google.com!newsfeed.google.com!sn-xit-02!supernews.com!news.tele.dk!small.news.tele.dk!194.25.134.62!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!news.fh-hannover.de!news.uni-stuttgart.de!nntp.cs.uni-magdeburg.de!PeerFeed.KWeb.on.ca!dnews
References: <3b8f9d25_1@dnews>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: fa7d6,ae980a0b9a6b38aa
X-Google-Attributes: gidfa7d6,public
X-Google-Thread: 1091e5,ae980a0b9a6b38aa
X-Google-Attributes: gid1091e5,public
X-Google-Thread: f5ca7,ae980a0b9a6b38aa
X-Google-Attributes: gidf5ca7,public
X-Google-Thread: 10d0fc,ae980a0b9a6b38aa
X-Google-Attributes: gid10d0fc,public
X-Google-ArrivalTime: 2001-08-31 23:34:47 PST
Message-ID: <3B907DBF.5CC168DD@borland.newsgroups>
Date: Sat, 01 Sep 2001 16:18:39 +1000
From: Charles Hacker <reply.to@borland.newsgroups>
X-Mailer: Mozilla 4.77 [en] (Win95; U)
X-Accept-Language: en,pdf
MIME-Version: 1.0
Newsgroups: borland.public.cppbuilder.multimedia,borland.public.cppbuilder.winapi,borland.public.delphi.multimedia,borland.public.delphi.winapi
Subject: Re: how to change mic volume?
References: <3b8f9d25_1@dnews>
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: 132.234.46.2
X-Trace: dnews 999325121 132.234.46.2 (31 Aug 2001 23:18:41 -0700)
Lines: 53
Path: arc1-ca.pugleaf.net!archiver1.google.com!newsfeed.google.com!sn-xit-02!supernews.com!news.tele.dk!small.news.tele.dk!194.25.134.62!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!news.fh-hannover.de!news.uni-stuttgart.de!nntp.cs.uni-magdeburg.de!PeerFeed.KWeb.on.ca!dnews