如何解决ACM的延迟问题呀?
还有
TGSM610=packed record //自定义音频文件头
wFormatTag: Word;
nChannels: Word;
nSamplesPerSec: DWORD;
nAvgBytesPerSec: DWORD;
nBlockAlign: Word;
wBitsPerSample: Word;
cbSize: Word;
wSamplesPerBlock:word;
end;procedure TForm1.FormCreate(Sender: TObject);
var
GSM:TGSM610;
Format:pointer;
begin
with GSM do
begin
wFormatTag:=$31;
nChannels:=1;
wBitsPerSample:=0;
nSamplesPerSec:=8000;
nBlockAlign:=65;
nAvgBytesPerSec:=1625;
cbSize:=2;
wSamplesPerBlock:=$140;
end;
format:=@GSM;
Wavein.Open(format);
Waveout.Open(Format);
end;
声音为什么是滴滴的响,没有声音呀?象发电报一样!
还有
TGSM610=packed record //自定义音频文件头
wFormatTag: Word;
nChannels: Word;
nSamplesPerSec: DWORD;
nAvgBytesPerSec: DWORD;
nBlockAlign: Word;
wBitsPerSample: Word;
cbSize: Word;
wSamplesPerBlock:word;
end;procedure TForm1.FormCreate(Sender: TObject);
var
GSM:TGSM610;
Format:pointer;
begin
with GSM do
begin
wFormatTag:=$31;
nChannels:=1;
wBitsPerSample:=0;
nSamplesPerSec:=8000;
nBlockAlign:=65;
nAvgBytesPerSec:=1625;
cbSize:=2;
wSamplesPerBlock:=$140;
end;
format:=@GSM;
Wavein.Open(format);
Waveout.Open(Format);
end;
声音为什么是滴滴的响,没有声音呀?象发电报一样!
buf: array[0..65535] of byte;
bufsize: Integer = 0;procedure TForm1.Button1Click(Sender: TObject);
var
format: Pointer;
GSM:TGSM610;
begin
with GSM do
begin
wFormatTag:=$31;
nChannels:=1;
wBitsPerSample:=0;
nSamplesPerSec:=8000;
nBlockAlign:=65;
nAvgBytesPerSec:=1625;
cbSize:=2;
wSamplesPerBlock:=$140;
end;
format:=@gsm;
ACMWaveIn1.Open(format);
ACMWaveOut1.Open(format);
end;procedure TForm1.ACMWaveIn1Data(data: Pointer; size: Integer);
begin
copymemory(pchar(@buf)+bufsize, data, size);
inc(bufsize, size);
if bufsize>=1300 then
begin
ACMWaveOut1.PlayBack(@buf, bufsize);
bufsize:=0;
end;
end;我是这样测试的,有声音啊
你用我的代码测试一下,我把延迟加长了一点,要不然分不清回放的声音和原声了
你还差我300分呢:)
那客户端和服务端怎么写呀?
拜托,等着结贴呀!
我还欠你300分呢