章
章慧
Unregistered / Unconfirmed
GUEST, unregistred user!
好像常见的混音控件都是对文件的,没啥用啊。
我按WaveMix的帮助在他的Demo上补上一个Button5
procedure TForm1.Button5Click(Sender: TObject);
Var
pChar;
z:TFilestream;
j,k,l,m:integer;
xMMIOINFO;
begin
z:=TFileStream.Create('1.wav',fmOpenRead);
i:=z.Size;
p:=AllocMem(i);
q:=p;
j:=i mod 8192;
k:=i div 8192;
for l:=1 to kdo
begin
if l=k then
m:=j else
m:=8192;
z.ReadBuffer(p^,m);
p:=p+m;
end;
z.Free;
WaveMix1.Close(w[2]);
x:=New(PMMIOINFO);
x.pchBuffer := q;
x.cchBuffer := i;
x.fccIOProc := FOURCC_MEM;
x.dwFlags := 0;
x.fccIOProc := 0;
x.wErrorRet := 0;
x.pchNext := Nil;
x.pchEndRead := Nil;
x.pchEndWrite := Nil;
x.pIOProc := Nil;
x.hTask := 0;
x.lBufOffset := 0;
x.lDiskOffset := 0;
x.dwReserved1 := 0;
x.dwReserved2 := 0;
x.adwInfo[0] := 0;
x.adwInfo[1] := 0;
x.adwInfo[2] := 0;
x.hmmio := 0;
//w[2] := WaveMix1.OpenFromFile('3.wav');
w[2] := WaveMix1.OpenFromMemory(x);
FreeMem(x);
end;
结果运行起来mmioOpen硬是在寻找RIFF头时失败,这是怎么回事?
我按WaveMix的帮助在他的Demo上补上一个Button5
procedure TForm1.Button5Click(Sender: TObject);
Var
pChar;
z:TFilestream;
j,k,l,m:integer;
xMMIOINFO;
begin
z:=TFileStream.Create('1.wav',fmOpenRead);
i:=z.Size;
p:=AllocMem(i);
q:=p;
j:=i mod 8192;
k:=i div 8192;
for l:=1 to kdo
begin
if l=k then
m:=j else
m:=8192;
z.ReadBuffer(p^,m);
p:=p+m;
end;
z.Free;
WaveMix1.Close(w[2]);
x:=New(PMMIOINFO);
x.pchBuffer := q;
x.cchBuffer := i;
x.fccIOProc := FOURCC_MEM;
x.dwFlags := 0;
x.fccIOProc := 0;
x.wErrorRet := 0;
x.pchNext := Nil;
x.pchEndRead := Nil;
x.pchEndWrite := Nil;
x.pIOProc := Nil;
x.hTask := 0;
x.lBufOffset := 0;
x.lDiskOffset := 0;
x.dwReserved1 := 0;
x.dwReserved2 := 0;
x.adwInfo[0] := 0;
x.adwInfo[1] := 0;
x.adwInfo[2] := 0;
x.hmmio := 0;
//w[2] := WaveMix1.OpenFromFile('3.wav');
w[2] := WaveMix1.OpenFromMemory(x);
FreeMem(x);
end;
结果运行起来mmioOpen硬是在寻找RIFF头时失败,这是怎么回事?