可以参考:
//显示波形
procedure TForm1.ShowWav(Header
WaveHdr);
var
i:integer;
r:real;
begin
//-----------------显示波形
if Header^.dwBytesRecorded>0 then
r:=form1.ClientWidth/Header^.dwBytesRecorded
else
r:=0;
PatBlt(form1.Canvas.Handle,0,0,form1.ClientWidth,form1.ClientHeight,BLACKNESS);//WHITENESS DSTINVERT DSTCOPY ...
(* oder form1.canvas.fillrect(form1.canvas.cliprect);
*)
form1.Canvas.Pen.Color:=clred;
form1.Canvas.MoveTo(0,127);
form1.Canvas.LineTo(form1.ClientWidth,127);
//alle 100 bytes einen dunkelroten Strich
form1.Canvas.Pen.Color:=clMaroon;
// form1.Canvas.Pen.Color:=clblue;
form1.Canvas.MoveTo(round(r*100),0);
form1.Canvas.LineTo(round(r*100),255);
form1.Canvas.MoveTo(round(r*200),0);
form1.Canvas.LineTo(round(r*200),255);
form1.Canvas.MoveTo(round(r*300),0);
form1.Canvas.LineTo(round(r*300),255);
form1.Canvas.MoveTo(round(r*400),0);
form1.Canvas.LineTo(round(r*400),255);
form1.Canvas.MoveTo(round(r*500),0);
form1.Canvas.LineTo(round(r*500),255);
form1.Canvas.MoveTo(round(r*600),0);
form1.Canvas.LineTo(round(r*600),255);
form1.Canvas.MoveTo(round(r*700),0);
form1.Canvas.LineTo(round(r*700),255);
form1.Canvas.MoveTo(round(r*800),0);
form1.Canvas.LineTo(round(r*800),255);
form1.Canvas.MoveTo(round(r*900),0);
form1.Canvas.LineTo(round(r*900),255);
form1.Canvas.MoveTo(round(r*1000),0);
form1.Canvas.LineTo(round(r*1000),255);
form1.Canvas.MoveTo(round(r*1100),0);
form1.Canvas.LineTo(round(r*1100),255);
form1.Canvas.MoveTo(round(r*1200),0);
form1.Canvas.LineTo(round(r*1200),255);
form1.Canvas.Pen.Color:=clLime;
// form1.Canvas.Pen.Color:=clblue;
form1.Canvas.MoveTo(0,PmemBlock(Header.lpData)^[0]);
for i:=0 to Header^.dwBytesRecorded-1do
form1.Canvas.lineTo(round(r*i),PmemBlock(Header.lpData)^
);
//-----------------显示波形
end;