AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Zurück Delphi-PRAXiS Programmierung allgemein Multimedia Delphi function SetWaveVolume...

function SetWaveVolume...

Ein Thema von spacewolf · begonnen am 20. Sep 2009 · letzter Beitrag vom 28. Sep 2009
Antwort Antwort
Benutzerbild von spacewolf
spacewolf

Registriert seit: 24. Apr 2003
Ort: Magdeburg
218 Beiträge
 
Delphi 7 Professional
 
#1

function SetWaveVolume...

  Alt 20. Sep 2009, 19:32
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...



der
Andreas
Andreas Göllner
("`-''-/").___..--''"`-._
`6_ 6 ) `-. ( ).`-.__.`)
"Ich kann Dir nur die Tür zeigen, durchgehen musst Du ganz allein."
Wer ist die Tür? Jesus!
  Mit Zitat antworten Zitat
Benutzerbild von spacewolf
spacewolf

Registriert seit: 24. Apr 2003
Ort: Magdeburg
218 Beiträge
 
Delphi 7 Professional
 
#2

Re: function SetWaveVolume...

  Alt 28. Sep 2009, 16:24
wees wirklich keener?
Andreas Göllner
("`-''-/").___..--''"`-._
`6_ 6 ) `-. ( ).`-.__.`)
"Ich kann Dir nur die Tür zeigen, durchgehen musst Du ganz allein."
Wer ist die Tür? Jesus!
  Mit Zitat antworten Zitat
Benutzerbild von DeddyH
DeddyH

Registriert seit: 17. Sep 2006
Ort: Barchfeld
27.537 Beiträge
 
Delphi 11 Alexandria
 
#3

Re: function SetWaveVolume...

  Alt 28. Sep 2009, 16:35
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?
Detlef
"Ich habe Angst vor dem Tag, an dem die Technologie unsere menschlichen Interaktionen übertrumpft. Die Welt wird eine Generation von Idioten bekommen." (Albert Einstein)
Dieser Tag ist längst gekommen
  Mit Zitat antworten Zitat
Benutzerbild von lbccaleb
lbccaleb

Registriert seit: 25. Mai 2006
Ort: Rostock / Bremen
2.037 Beiträge
 
Delphi 7 Enterprise
 
#4

Re: function SetWaveVolume...

  Alt 28. Sep 2009, 17:15
Schaue dir mal diesen Code dazu an

Volume Left/Right
Martin
MFG Caleb
TheSmallOne (MediaPlayer)
Die Dinge werden berechenbar, wenn man die Natur einer Sache durchschaut hat (Blade)
  Mit Zitat antworten Zitat
Benutzerbild von turboPASCAL
turboPASCAL

Registriert seit: 8. Mai 2005
Ort: Sondershausen
4.274 Beiträge
 
Delphi 6 Personal
 
#5

Re: function SetWaveVolume...

  Alt 28. Sep 2009, 17:17
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;
Matti
Meine Software-Projekte - Homepage - Grüße vom Rüsselmops -Mops Mopser
  Mit Zitat antworten Zitat
Themen-Optionen Thema durchsuchen
Thema durchsuchen:

Erweiterte Suche
Ansicht

Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 15:37 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