Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Multimedia (https://www.delphipraxis.net/16-multimedia/)
-   -   Delphi function SetWaveVolume... (https://www.delphipraxis.net/140551-function-setwavevolume.html)

spacewolf 20. Sep 2009 19:32


function SetWaveVolume...
 
Moin,

kann mir einer sagen warum die folgende Funktion:

Delphi-Quellcode:
function SetWaveVolume(const AVolume: DWORD): Boolean;
var
  WaveOutCaps: TWAVEOUTCAPS;
begin
  Result := False;
  if WaveOutGetDevCaps(WAVE_MAPPER, @WaveOutCaps, SizeOf(WaveOutCaps)) = MMSYSERR_NOERROR then
    if WaveOutCaps.dwSupport and WAVECAPS_VOLUME = WAVECAPS_VOLUME then
      Result := WaveOutSetVolume(WAVE_MAPPER, AVolume) = MMSYSERR_NOERROR;
end;
nur eine Seite des Lautsprechers setzt die andere aber auf 0 - das heißt das WAVEOUT gibt dann nur noch mono wieder...

:wall:

der
Andreas :zwinker:

spacewolf 28. Sep 2009 16:24

Re: function SetWaveVolume...
 
:wall: wees wirklich keener?

DeddyH 28. Sep 2009 16:35

Re: function SetWaveVolume...
 
Zitat:

Zitat von MSDN
The low-order word contains the left-channel volume setting, and the high-order word contains the right-channel setting.
...
If a device does not support both left and right volume control, the low-order word of dwVolume specifies the volume level, and the high-order word is ignored.

Wie sieht AVolume denn aus, heißt welche Zahl übergibst Du?

lbccaleb 28. Sep 2009 17:15

Re: function SetWaveVolume...
 
Schaue dir mal diesen Code dazu an ;)

Volume Left/Right

turboPASCAL 28. Sep 2009 17:17

Re: function SetWaveVolume...
 
Siehe dazu:
http://www.delphipraxis.net/internal...=686662#686662

http://www.swissdelphicenter.ch/de/showcode.php?id=630 schreibt:

Delphi-Quellcode:
{
  AVolume:
  The low-order word contains the left-channel volume setting,
  and the high-order word contains the right-channel setting.
  A value of 65535 represents full volume, and a value of 0000 is silence.
  If a device does not support both left and right volume control,
  the low-order word of dwVolume specifies the volume level,
  and the high-order word is ignored.
}


{ *** How to Use: ***}

// SetWaveVolume:

procedure TForm1.Button1Click(Sender: TObject);
var
  LVol: Word;
  RVol: Word;
begin
  LVol := SpinEdit1.Value; // max. is 65535
  RVol := SpinEdit2.Value; // max. is 65535
  SetWaveVolume(MakeLong(LVol, RVol));
end;


Alle Zeitangaben in WEZ +1. Es ist jetzt 10:47 Uhr.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz