Autor Beitrag
cybersoul
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 43



BeitragVerfasst: Fr 21.01.05 23:41 
Hi Leute.

Kennt jemand eine Möglichkeit,wie man an das RICHTIGE Master Volume,
also an die Gesamtlautstärke von Windows kommt?

Mit den mixer-Befehlen von Windows (mixerOpen,mixerGetLineInfo,...)
kenne ich mich aus, habe aber auch dort nicht das Richtige gefunden.

Ich möchte keine Komponente benutzen!

Heiko
Karlson
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 2088



BeitragVerfasst: Fr 21.01.05 23:57 
Ich habe mir vor unzeiten mal so inetwa diesen code zusammengesucht:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
procedure MasterVolume(const lautstarrke : Word);
var
 W1 : hwaveout;
 W2 : twaveformatex;
begin
 FillChar(w2, SizeOf(w2), 0);
 WaveOutOpen(@W1, WAVE_MAPPER, @W2, 000);
 waveOutSetVolume(w1, lautstarrke);
 WaveOutClose(w1);
end;


Er verändert allerdings nur die wavelautstärke, mir hat dsa bis dato immer gereicht.
Ob er so stimmt weiss ich nicht genau (bin mir bei dem einem Flag nicht mehr sicher), habe kein Delphi zum überprüfen da.
cybersoul Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 43



BeitragVerfasst: Sa 22.01.05 00:07 
Ganeu das wollte ich ja nicht!
Ich meine die Gesamtlautstärke!
NeoInDerMATRIX
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 245

Win95, Win98(+se), WinNT, Win2000, WinME, WinXP(+pro), VISTA, Linux(SuSe), DOS [MultiMon(3)], Vista
D6 PeE + (FP 2.0l) + D3 Pe + D2005+ D2006 Arch
BeitragVerfasst: Sa 22.01.05 00:17 
Hi,

schau mal unter Audio Mixer Function im WinSDK.

Cu
Neo
cybersoul Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 43



BeitragVerfasst: Sa 22.01.05 01:00 
Danke, aber das hab ich schon alles durch.
retnyg
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2754

SNES, GB, GBA, CPC, A500, 486/66, P4/3.0HT: NintendOS, AmigaOS, DoS
Delphi 5, Delphi 7
BeitragVerfasst: Sa 22.01.05 04:16 
steht bei swissdelphicenter.ch unter tipsuche, stichwort lautstärke oder volume
cybersoul Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 43



BeitragVerfasst: Sa 22.01.05 14:02 
Liest sich hier eigentlich jemand die Threads durch oder
wird einfach nur mal so auf den Titel geantwortet?

Aber egal, mal wieder musste ich den Fehler selber finden.
Für alle die das gleiche Problem haben, hier mal ein kleiner
Beispiel-Code :

ausblenden volle Höhe Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
72:
73:
74:
75:
76:
77:
78:
79:
80:
81:
82:
83:
84:
85:
86:
87:
88:
89:
RE:TRichedit;

procedure tform1.UpdateList;
var
  c,i,iLine,iCtrl,iCon:integer;
  h:HMixer;
  caps:PMixerCaps;
  Line,Line2:PMixerLine;
  ctrls:PMixerLineControls;
  pctrl:PMixerControl;
begin
  c:=mixerGetNumDevs;
  re.lines.add('DeviceCount: '+inttostr(c));

  for i:=0 to c-1 do
    if mixerOpen(@h,i,0,HInstance,MIXER_OBJECTF_MIXER) = MMSYSERR_NOERROR then begin

      // Device Caps ( Infos zum Treiber )
      if mixerGetDevCaps(h,@caps,sizeof(caps)) = MMSYSERR_NOERROR then begin
        re.lines.add('');
        re.lines.add(inttostr(i)+': '+caps.szPname);
        re.lines.add('  - Driver-Version: '+ inttostr(caps.vDriverVersion) );
        re.lines.add('  - Destinations: '+ inttostr(caps.cDestinations) );

        // Line-Destinations ( Volume Control, Recording Control,... )
        for iLine:=0 to caps.cDestinations-1 do begin
          line.cbStruct:=sizeof(line);
          line.dwDestination:=iLine;
          if mixerGetLineInfo(h,@line,MIXER_GETLINEINFOF_DESTINATION) = MMSYSERR_NOERROR then begin

            re.lines.add('');
            re.lines.add('    - '+inttostr(iLine)+': '+line.szName+' ['+line.szShortName+']');
            case line.Target.dwType of
              mixerline_targettype_aux: re.lines.add('      - TargetType: aux');
              mixerline_targettype_midiin: re.lines.add('      - TargetType: midiin');
              mixerline_targettype_midiout: re.lines.add('      - TargetType: midiout');
              mixerline_targettype_undefined: re.lines.add('      - TargetType: undefined');
              mixerline_targettype_wavein: re.lines.add('      - TargetType: wavein');
              mixerline_targettype_waveout: re.lines.add('      - TargetType: waveout');
              end;
            re.lines.add('      - Channels: '+inttostr(line.cChannels));
            re.lines.add('      - Controls: '+inttostr(line.cControls));

            // Line-Controls ( Master Controls [Volume,Mute] )
            ctrls.cbStruct:=sizeof(ctrls);
            ctrls.cControls:=line.cControls;
            ctrls.cbmxctrl:=sizeof(TMixerControl);
            GetMem(pctrl,SizeOf(TMixerControl)*line.cControls);
            ctrls.pamxctrl:=pctrl;
            if mixerGetLineControls(h,@ctrls,MIXER_GETLINECONTROLSF_ALL) = mmsyserr_noerror then
              for iCtrl:=0 to line.cControls-1 do begin
                re.lines.add('        - '+inttostr(iCtrl)+': '+pctrl^.szName);
                inc(pctrl);
                end;
            FreeMem(pCtrl);

            // Line-Connections  ( WAVE, LineIn, Mic, CD, usw. )
            re.lines.add('      - Connections: '+inttostr(line.cConnections));
            line2.cbStruct:=sizeof(TMixerLine);
            line2.dwDestination:=line.dwDestination;
            for iCon:=0 to line.cConnections-1 do begin
              line2.dwSource:=iCon;

              if mixerGetLineInfo(h,@line2,MIXER_GETLINEINFOF_SOURCE) = mmsyserr_noerror then begin
                re.Lines.add('        - '+inttostr(iCon)+': '+line2.szName+'  |  Channels:'+inttostr(line2.cChannels)+'  |  Controls:'+inttostr(line2.cControls));

                // Connection-Controls ( Volume,Mute,usw. )
                ctrls.cbStruct:=sizeof(ctrls);
                ctrls.dwLineID:=line2.dwLineID;
                ctrls.cControls:=line2.cControls;
                ctrls.cbmxctrl:=sizeof(TMixerControl);
                GetMem(pctrl,sizeof(tmixercontrol)*line2.cControls);
                ctrls.pamxctrl:=pctrl;
                if mixerGetLineControls(h,@ctrls,MIXER_GETLINECONTROLSF_ALL) = mmsyserr_noerror then
                  for iCtrl:=0 to ctrls.cControls-1 do begin
                    re.lines.add('          - '+inttostr(iCtrl)+': '+pctrl^.szName);
                    inc(pctrl);
                    end;
                FreeMem(pctrl);

                end;
              end;
            end;
          end;
        end;

      mixerClose(h);
      end;
end;


Moderiert von user profile iconraziel: Code- durch Delphi-Tags ersetzt.
NeoInDerMATRIX
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 245

Win95, Win98(+se), WinNT, Win2000, WinME, WinXP(+pro), VISTA, Linux(SuSe), DOS [MultiMon(3)], Vista
D6 PeE + (FP 2.0l) + D3 Pe + D2005+ D2006 Arch
BeitragVerfasst: So 23.01.05 16:53 
Hallo,

dir ist schon bewust das genau das auf dem Link den ich dir gepostet habe steht! Aber wenn du keine Hilfe annimst kann hier keiner etwas dafür.
:(
Cu
Neo