Autor Beitrag
Syngel Kid
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 61

Win XP
Delphi 2005
BeitragVerfasst: Di 03.08.04 12:43 
Tja, wie kann ich das machen (Im Programm selbst)??

Den der MediaPlayer nimmt ja das auf, was im Recording Control angegeben ist und standart ist leider Microphone, aber ich möchte Midi oder Wave!

Kann man das nicht mit den Mixer funktionen oder so umstellen??
thebe
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 128

WinXP Home
D6 Enterprise
BeitragVerfasst: Di 03.08.04 13:43 
Du kannst da den Line-In auswählen. Hol dir nen Kabel was Du vom Line-Out in den Line-In steckst und Du kannst alles aufnehmen was Du am Rechner machst.
Syngel Kid Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 61

Win XP
Delphi 2005
BeitragVerfasst: Di 03.08.04 20:14 
thebe hat folgendes geschrieben:
Du kannst da den Line-In auswählen. Hol dir nen Kabel was Du vom Line-Out in den Line-In steckst und Du kannst alles aufnehmen was Du am Rechner machst.


Nun, leider habe ich so ein Kabel nicht und es ist einfach naja ein bisschen irre...

Da kann ich ja viel bequemer einfach auf das umstellen was ich brauch...
Syngel Kid Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 61

Win XP
Delphi 2005
BeitragVerfasst: Do 05.08.04 08:03 
Titel: Nix los??
Weiss den hier niemand eine Lösung ich suche jeden Tag im Internet, aber finde nichts!!

Ich dachte dem Ingineur ist nichts zu schwör... :D
Syngel Kid Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 61

Win XP
Delphi 2005
BeitragVerfasst: Mi 11.08.04 08:44 
Ok, ich habs jetzt rausgefunden!!!

Leider funkioniert es noch nicht so ganz wie es sollte :(
Die Funktion ergibt immer den Wert 0, egal wo der Switch (Kreuzchen) gesetzt ist...

Hier der Source-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:
90:
91:
function GetRecorderDevice: Integer;

  function Error(ResultA: Cardinal; const FunctionA: String = ''): Boolean; //Errorfunktion, nichts besonderes...
  begin
    If ResultA <> 0 then
    begin
      Result := False;
      If FunctionA <> '' then
        raise Exception.CreateFmt('ERROR: [%s] returns [%d]!', [FunctionA, ResultA])
      else
        raise Exception.CreateFmt('Error as a undefinied function!', []);
    end
    else
      Result := True;
  end;

var
  MixId: Cardinal;
  MixHandle: HMixer;
  DesFound: Boolean;

  Destination: TMixerLine;

  Caps: TMixerCaps;
  MixerControls: TMixerLineControls;
  Controls: array[0..9] of TMixerControl;
  Values: TMixerControlDetails;
  ValueMute: array[0..1] of MIXERCONTROLDETAILS_BOOLEAN;

  i: Cardinal;

  Ret: MMResult;
begin
  MixId := 0;
  Ret := mixerOpen(@MixHandle, MixId, 0, 0, 0); //Also, erst mal Mixer öffnen!
  Error(Ret);

  Ret := mixerGetDevCaps(MixHandle, @Caps, SizeOf(Caps)); //Dann die Anzahl DestinationLines abrufen!
  Error(Ret);

  DesFound := False;
  for i := 0 to Caps.cDestinations do
  begin
    DesFound := False;
    Destination.cbStruct := SizeOf(Destination);
    Destination.dwDestination := i;
    Destination.dwSource := 0;
    Ret := mixerGetLineInfo(MixHandle, @Destination, MIXER_GETLINEINFOF_DESTINATION);
    Error(Ret);
    If Destination.dwComponentType = MIXERLINE_COMPONENTTYPE_DST_WAVEIN  then // Jetzt die Recording Destination suchen!
    begin
      DesFound := True;
      Break;
    end;
  end;
  If DesFound = False then Error(1);

  MixerControls.cbStruct := SizeOf(MixerControls);
  MixerControls.cControls := 10;
  MixerControls.cbmxctrl := SizeOf(TMixerControl);
  MixerControls.pamxctrl := @Controls;
  MixerControls.dwLineID := Destination.dwLineID;

  Ret := mixerGetLineControls(MixHandle, @MixerControls, MIXER_GETLINECONTROLSF_ALL); //Danach alle Controls abrufen und...
  Error(Ret);

  i := 0;
  while Controls[i].dwControlType <> MIXERCONTROL_CONTROLTYPE_MUX do //...Die richtige Suchen, (Bei mir heisst sie "Recorder Select Switch", aber immer nach Type oder ID suchen!
  begin
    If i > 100 then
    begin
      Error(1);
    end;
    i := i +1;
  end;

  Values.cbStruct := SizeOf(Values);
  Values.dwControlID := Controls[i].dwControlID;
  Values.cChannels := Destination.cChannels;
  Values.cMultipleItems := Controls[i].cMultipleItems;
  Values.cbDetails := SizeOf(ValueMute);
  Values.paDetails := @ValueMute;

  Ret := mixerGetControlDetails(MixHandle, @Values, MIXER_GETCONTROLDETAILSF_VALUE); //Zum schluss nur noch den Wert des Controls suchen!
  Error(Ret);

  Result := ValueMute[1].fValue;

  Ret := mixerClose(MixHandle); // Und schliesslich den Mixer wieder schliessen, so schwer ist es eigentlich gar nicht...
  Error(Ret);
end;



Hat irgendwer ne ahnung, wieso da der Wert 0 zurückkommt??

MfG Syngel Kid