Club Delphi  
    Paypal   FTP   CCD     Buscar   Trucos   Trabajo   Foros

Retroceder   Foros Club Delphi > Principal > API de Windows
Registrarse FAQ Miembros Calendario Guía de estilo Buscar Temas de Hoy Marcar Foros Como Leídos

 
 
Herramientas Buscar en Tema Desplegado
  #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.964
Poder: 29
delphi.com.ar Va camino a la fama
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
 


Herramientas Buscar en Tema
Buscar en Tema:

Búsqueda Avanzada
Desplegado

Normas de Publicación
no Puedes crear nuevos temas
no Puedes responder a temas
no Puedes adjuntar archivos
no Puedes editar tus mensajes

El código vB está habilitado
Las caritas están habilitado
Código [IMG] está habilitado
Código HTML está deshabilitado
Saltar a Foro

Temas Similares
Tema Autor Foro Respuestas Último mensaje
Grabar sonido desde un microfono gaston260 API de Windows 4 16-07-2008 04:00:31
Obtener audio desde un microfono en delphi fide API de Windows 3 13-04-2008 20:33:07
sonido y microfono en delphi cmm07 Varios 0 07-04-2008 14:59:18
microfono de alta sensibilidad b3nshi Varios 0 16-04-2005 20:26:51
Cambiar el volumen de grabación del micrófono syntetiko API de Windows 0 25-01-2005 19:11:58


La franja horaria es GMT +2. Ahora son las 12:37:08.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
Traducción al castellano por el equipo de moderadores del Club Delphi
Copyright 1996-2007 Club Delphi