这是我读取 .wav 文件的代码的一部分
//Variable
wavehdr:TWaveHeader;
ckiRIFF,ckiFmt,ckiData,ckiLIST: TMMCKInfo;
mmioinfo: PMMIOInfo;
waveFmt: TWaveFormatEx;
buf: Array of smallint;
buf_recon: Array of double;
list:Array of longint; // THIS IS MY GUESS so it's definetly not work
HMMIO: hFile;
//Locate the "RIFF" chunk
ckiRIFF.fccType := mmioStringToFOURCC('WAVE',0);
mmioDescend(HMMIO, @ckiRIFF, nil, MMIO_FINDRIFF);
mmioAscend(HMMIO, @ckiRIFF, MMIO_FINDRIFF);
//Locate the "FMT" subchunk
ckiFmt.ckid := mmioStringToFOURCC('fmt', 0);
mmioDescend(HMMIO, @ckiFmt, nil, MMIO_FINDCHUNK);
mmioRead(HMMIO, @waveFmt, ckiFmt.cksize);
mmioAscend(HMMIO, @ckiFmt, 0);
//Locate the "LIST" chunk (THIS PART IS NOT WORK)
ckiLIST.fccType := mmioStringToFOURCC('LIST',0);
mmioDescend(HMMIO, @ckiLIST, nil, MMIO_FINDLIST);
mmioRead(HMMIO, @list, ckiLIST.cksize);
mmioAscend(HMMIO, @ckiFmt, 0);
//Locate the "data" subchunk
ckiData.ckid := mmioStringToFOURCC('data', 0);
if (mmioDescend(HMMIO, @ckiData, @ckiRIFF, MMIO_FINDCHUNK) = MMSYSERR_NOERROR) then begin
SetLength(buf, ckiData.cksize);
mmioRead(HMMIO, PAnsiChar(buf), ckiData.cksize);
它工作得非常完美,直到我意识到我错过了 LIST 块,我只能设法得到“LIST”。这是我读取和写回文件之前的文件示例,并且有列表块及其数据
这是在我读完并写回来之后
我标记的部分不见了。所以如果有人知道我的错误在这里请帮助我
编辑 1