alow 如何转换成 gsm6.10 格式 [请会的帮忙一下](200分)

  • 主题发起人 主题发起人 sbzldlb
  • 开始时间 开始时间
S

sbzldlb

Unregistered / Unconfirmed
GUEST, unregistred user!
alow 如何转换成 gsm6.10 格式 [请会的帮忙一下]
 
请高手看一下,这段代码为什么有问题
当执行到 acmStreamOpen 是 结果是512 ,请高手帮忙啊

procedure TForm1.Button1Click(Sender: TObject);
begin

Button2.click;


with FormatSrcdo

begin

wFormatTag := 7;
nChannels := 1;
nSamplesPerSec := 8000;
nAvgBytesPerSec := 8000;
nBlockAlign := 1;
wBitsPerSample := 8;
cbSize := 0;
end;


with FormatDescdo

begin

wFormatTag :=$31;
//WAVE_FORMAT_GSM610;
set default format to GSM6.10
nChannels := 1;
//mono
nSamplesPerSec := 8000;
nAvgBytesPerSec:= 1625;
{ for buffer estimation }
nBlockAlign:=65;
{ block size of data }
wbitspersample := 0;
cbSize:=2;
end;


mmr := acmStreamOpen(@acmStreamHandler,
0, // driver handle
FormatSrc, // source format
FormatDesc, // destination format
Nil, // no filter
0, // no callback
0, // instance data (not used)
ACM_STREAMOPENF_NONREALTIME);// flags


acmStreamSize(acmStreamHandler, pcm.dLen, pcmsize, ACM_STREAMSIZEF_SOURCE);

DataDesc := Pbyte(AllocMem(pcm.dLen + 1));

acmheader.cbStruct := sizeof(TACMSTREAMHEADER);
acmheader.cbSrcLength := pcm.dLen;
acmheader.pbSrc := DataSrc;
acmheader.cbDstLength := pcmsize;
acmheader.pbDst := DataDesc;

mmr := acmStreamPrepareHeader(acmStreamHandler, acmheader, 0);
mmr := acmStreamConvert(acmStreamHandler, acmheader, ACM_STREAMCONVERTF_BLOCKALIGN);

while (0 = (ACMSTREAMHEADER_STATUSF_DONE and acmheader.fdwStatus))do

begin

end;


mmr := acmStreamUnprepareHeader(acmStreamHandler, acmheader, 0);
end;
 
关注此问题,支持一下
 
高手啊在啊
 
邮件已发出,请查收.[:D]
 
接受答案了.
 
后退
顶部