K
kkkchenA
Unregistered / Unconfirmed
GUEST, unregistred user!
我用indy控件接收后,用acmout进行回放,但是它提示说“stream read error”
下面是接收部分代码,我是初学者,请帮忙。。。。
procedure TUDPMainForm.UDPServerUDPRead(Sender: TObject;
AData: TStream;
ABinding: TIdSocketHandle);
var
DataStringStream: TStringStream;
s: string;
begin
with GSM610do
begin
wFormatTag := $31;
nChannels := 1;
wBitsPerSample := 0;
nSamplesPerSec := 8000;
nBlockAlign := 65;
nAvgBytesPerSec := 1625;
cbSize := 2;
wSamplesPerBlock := $140;
end;
ACMFormat := @GSM610;
ACMWaveOut1.Open(ACMFormat);
ss:= TMemoryStream.Create;
try
ss.CopyFrom(AData,AData.Size) ;
ACMWaveOut1.PlayBack(ss.Memory, ss.Size);
finally
ss.Free;
end;
end;
下面是接收部分代码,我是初学者,请帮忙。。。。
procedure TUDPMainForm.UDPServerUDPRead(Sender: TObject;
AData: TStream;
ABinding: TIdSocketHandle);
var
DataStringStream: TStringStream;
s: string;
begin
with GSM610do
begin
wFormatTag := $31;
nChannels := 1;
wBitsPerSample := 0;
nSamplesPerSec := 8000;
nBlockAlign := 65;
nAvgBytesPerSec := 1625;
cbSize := 2;
wSamplesPerBlock := $140;
end;
ACMFormat := @GSM610;
ACMWaveOut1.Open(ACMFormat);
ss:= TMemoryStream.Create;
try
ss.CopyFrom(AData,AData.Size) ;
ACMWaveOut1.PlayBack(ss.Memory, ss.Size);
finally
ss.Free;
end;
end;