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 Temas de Hoy

 
 
Herramientas Buscar en Tema Desplegado
  #8  
Antiguo 31-01-2008
Avatar de seoane
[seoane] seoane is offline
Miembro Premium
 
Registrado: feb 2004
Ubicación: A Coruña, España
Posts: 3.717
Poder: 26
seoane Va por buen camino
Vamos a ver, tu tienes este procedure:
Código Delphi [-]
procedure TfrmMain.BufferFinished(var Msg: TMessage);
var
  hdr: PWaveHdr;
  i: integer;
  P: PByte;
begin
  hdr:= PWaveHdr(Msg.LParam);
  with hdr^ do
    begin
      P:= PByte(lpData);
      Canvas.FillRect(Canvas.ClipRect);
      Canvas.MoveTo(width,128);
      Canvas.LineTo(0,128);
      for i:= 1 to dwBytesRecorded  do
        begin
          Canvas.LineTo(i,P^);
          inc(P);
        end;
    end;

  if waveInPrepareHeader(Device,hdr,sizeof(TWAVEHDR))<>MMSYSERR_NOERROR then
     begin
       CloseWaveDevice;
       exit;
     end;
  if waveInAddBuffer(Device,hdr,sizeof(TWAVEHDR))<>MMSYSERR_NOERROR then
    begin
      CloseWaveDevice;
      exit;
    end;
end;

Pues deberías hacer algo como esto:
Código Delphi [-]
procedure TfrmMain.BufferFinished(var Msg: TMessage);
var
  hdr: PWaveHdr;
  i: integer;
  P: PByte;
  B: Byte;
begin
  hdr:= PWaveHdr(Msg.LParam);
  with hdr^ do
    begin
      P:= PByte(lpData);
      B:= 0;
      for i:= 1 to dwBytesRecorded  do
        begin
          if P^ > B then
            B:= P^;
          inc(P);
        end;
      // Aqui haz lo que quieras con B, por ejemplo
      ProgressBar1.Position:= B; 
      // O incluso esto otro
      dec(B,128);
      ProgressBar1.Position:= B; 
    end;

  if waveInPrepareHeader(Device,hdr,sizeof(TWAVEHDR))<>MMSYSERR_NOERROR then
     begin
       CloseWaveDevice;
       exit;
     end;
  if waveInAddBuffer(Device,hdr,sizeof(TWAVEHDR))<>MMSYSERR_NOERROR then
    begin
      CloseWaveDevice;
      exit;
    end;
end;
Responder Con Cita
 



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
ayuda con puntero lmcz OOP 1 19-10-2007 14:46:54
Puntero Humano vtdeleon La Taberna 14 16-02-2007 21:41:10
puntero *pantalla en c++ coletaun Varios 15 21-07-2006 14:46:04
puntero a imagen Abaddon Gráficos 9 16-06-2005 00:17:29
Puntero a Stream Enan0 Varios 3 22-03-2005 22:08:13


La franja horaria es GMT +2. Ahora son las 15:19:59.


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