请问大家看一下这段代码是否可行.如果不行要怎么改??? ( 积分: 100 )

  • 主题发起人 主题发起人 wenwenbin
  • 开始时间 开始时间
W

wenwenbin

Unregistered / Unconfirmed
GUEST, unregistred user!
procedure TForm1.ACMWaveIn1Data(data: Pointer;
size: Integer);
var
pi, po: Pchar;
i: Integer;
List: TList;
zero: Integer;
PeakL, PeakR: Smallint;
BUF: array of Byte;
begin

zero := 0;
pi := data;
po := @Audiobuf;
po := po + AudioSize;
va_g729a_encoder(pi, po);
AudioSize := AudioSize + 10;
if AudioSize >= 3000 then

AudioSize := 0;
//pcmFindPeak(@PCMFOMAT, Data, Size, PeakL, PeakR);
//TrackBarMic.SelStart := 32767-ABS(PeakL);
if AudioSize <
60 then
exit;
setlength(BUF, AudioSize);
Move(AudioBuf, BUF[0], AudioSize);
IdUDPServer1.SendBuffer('192.168.1.189',4646,BUF[0], AudioSize);
AudioSize := 0;
end;
 
procedure TForm1.ACMWaveIn1Data(data: Pointer;
size: Integer);
var
pi, po: Pchar;
i: Integer;
List: TList;
zero: Integer;
PeakL, PeakR: Smallint;
BUF: array of Byte;
begin

zero := 0;
pi := data;
po := @Audiobuf;
po := po + AudioSize;
va_g729a_encoder(pi, po);
AudioSize := AudioSize + 10;
if AudioSize >= 3000 then

AudioSize := 0;
//pcmFindPeak(@PCMFOMAT, Data, Size, PeakL, PeakR);
//TrackBarMic.SelStart := 32767-ABS(PeakL);
if AudioSize <
60 then
exit;
setlength(BUF, AudioSize);
Move(AudioBuf, BUF[0], AudioSize);
IdUDPServer1.SendBuffer('192.168.1.189',4646,BUF[0], AudioSize);
AudioSize := 0;
end;
 
后退
顶部