附原程序,核心部分来自电脑报一文章,原来我用TURBO PASCAL 编的,效果比现在好些,
现在用了一个端口控件:smallport
procedure TForm1.SpeedButton4Click(Sender: TObject);
CONST NMAXBUF=640000;{一次读取的内容}
SLOWER=13;
VAR I:LONGINT;READED:INTEGER;VOL,J:INTEGER;CH:CHAR;
Z,ADD:INTEGER;
FP:FILE;FILENAME:STRING[20];
AVOL:ARRAY[1..NMAXBUF] OF BYTE;
begin
SmallPort1.PORT[$43]:=$A4;
SmallPort1.PORT[$42]:=$FF;
AssignFile(FP,'HUA.wav');
RESET(FP,1);
SEEK(FP,44);
REPEAT
BLOCKREAD(FP,AVOL,NMAXBUF,READED);
FOR I:=1 TO NMAXBUFdo
begin
SmallPort1.PORT[$61]:=SmallPort1.PORT[$61] AND $FC;
FOR J:=1 TO AVOL*SLOWERdo
{这句}
SmallPort1.PORT[$61]:=SmallPort1.PORT[$61] OR $03;
FOR J:=1 TO ($FF-AVOL)*SLOWERdo
{和这句不是很明白}
end;
UNTIL READED=0;
CLOSEFILE(FP);
end;