![]() |
Order and save right now!
20% off with the 729824315 dicscount code for Ultimate Pack and any another product for Delphi from Greatis Programming! |
⤷ Set sound volume
To change sound volume, use WaveOutSetVolume function. A value of 0xFFFF represents full volume, and a value of 0x0000 is silence.
uses mmsystem;
procedure TForm1.Button1Click(Sender: TObject);
var
MyWaveOutCaps: TWaveOutCaps;
Volume: Integer;
begin
Volume:=Scrollbar1.Position;
if WaveOutGetDevCaps(
WAVE_MAPPER,
@MyWaveOutCaps,
sizeof(MyWaveOutCaps))=MMSYSERR_NOERROR then
WaveOutSetVolume(WAVE_MAPPER, MakeLong(Volume, Volume));
end;
-
More for developers