Ver Mensaje Individual
  #2  
Antiguo 18-01-2010
Avatar de delphi.com.ar
delphi.com.ar delphi.com.ar is offline
Federico Firenze
 
Registrado: may 2003
Ubicación: Buenos Aires, Argentina *
Posts: 5.932
Reputación: 27
delphi.com.ar Va por buen camino
Debes hacerlo mediante el mixer de windows, te paso una unit que alguna vez escribí y como utilizarla:

Código Delphi [-]
{********************************************************}
{                                                        }
{    Multimedia Utils                                    }
{                                                        }
{    Autor: Federico Firenze                             }
{    enero de 2003                                       }
{                                                        }
{********************************************************}

unit MMUtils;

interface

uses
  Windows;

procedure mmMixSetVolume(AComponentType, AValue: DWORD);
procedure mmMixSetMute(AComponentType: DWORD; AValue: boolean);

implementation

uses
  SysUtils, MMSystem;

procedure RaiseLastMMError;
begin
  { TODO : .. }
  RaiseLastOsError;
end;

procedure mmMixSetDetail(AComponentType, AControlType: DWORD; Data: Pointer; DataSize: DWORD);
var
  hMix: HMIXER;
  mxlc: MIXERLINECONTROLS;
  mxcd: TMIXERCONTROLDETAILS;
  mxc: MIXERCONTROL;
  mxl: TMixerLine;
begin
  if (mixerGetNumDevs() > 0) then
  begin
    if mixerOpen(@hMix, 0, 0, 0, 0) = MMSYSERR_NOERROR then
      try
        mxl.dwComponentType := AComponentType;
        mxl.cbStruct := SizeOf(mxl);

        if mixerGetLineInfo(hMix, @mxl, MIXER_GETLINEINFOF_COMPONENTTYPE) = MMSYSERR_NOERROR then
        begin
          ZeroMemory(@mxlc, SizeOf(mxlc));

          mxlc.cbStruct := SizeOf(mxlc);
          mxlc.dwLineID := mxl.dwLineID;
          mxlc.dwControlType := AControlType;
          mxlc.cControls := 1;
          mxlc.cbmxctrl := SizeOf(mxc);
          mxlc.pamxctrl := @mxc;

          if mixerGetLineControls(hMix, @mxlc, MIXER_GETLINECONTROLSF_ONEBYTYPE) = MMSYSERR_NOERROR then
          begin
            ZeroMemory(@mxcd, SizeOf(mxcd));
            mxcd.dwControlID := mxc.dwControlID;
            mxcd.cbStruct := SizeOf(mxcd);
            mxcd.cMultipleItems := 0;
            mxcd.cbDetails := DataSize;
            mxcd.paDetails := Data;
            mxcd.cChannels := 1;

            if mixerSetControlDetails(hMix, @mxcd, MIXER_SETCONTROLDETAILSF_VALUE) <> MMSYSERR_NOERROR then
              RaiseLastMMError;
          end else
            RaiseLastMMError;
        end else
          RaiseLastMMError;
      finally
        if mixerClose(hMix) <> MMSYSERR_NOERROR then
         RaiseLastMMError;
      end;
  end;
end;

procedure mmMixSetVolume(AComponentType, AValue: DWORD);
var
  uValue: TMIXERCONTROLDETAILS_UNSIGNED;
begin
  uValue.dwValue := AValue;
  mmMixSetDetail(AComponentType, MIXERCONTROL_CONTROLTYPE_VOLUME, @uValue, SizeOf(uValue));
end;


procedure mmMixSetMute(AComponentType: DWORD; AValue: boolean);
var
  bValue: MIXERCONTROLDETAILS_BOOLEAN;
begin
  bValue.fValue := Ord(AValue);
  mmMixSetDetail(AComponentType, MIXERCONTROL_CONTROLTYPE_MUTE, @bValue, SizeOf(bValue));
end;

end.

Aquí utiliza la función mmMixSetMute para poner el micrófono en estado mute, para salir de este estado el segundo parámetro debería ser False.
Código Delphi [-]
uses MMUtils, MMSystem;

{$R *.dfm}

procedure TForm1.FormCreate(Sender: TObject);
begin
  mmMixSetMute(MIXERLINE_COMPONENTTYPE_SRC_MICROPHONE, True);
end;

Saludos!
__________________
delphi.com.ar

Dedique el tiempo suficiente para formular su pregunta si pretende que alguien dedique su tiempo en contestarla.
Responder Con Cita