在一个相当大的命令行应用程序的中间,它一直在工作。进行了一些更改以处理大于我可以缓冲的文件并遇到来自fread
.
DebugLog(@"Reading %d samples of a total %d samples of size %d, leaving %d samples remaining", numSamplesToRead, numSamplesInFile, sizeof(short) * channels * scaleFactor, numSamplesRemainingInFile);
DebugLog(@"Position in file is %d", ftell(in));
items = fread(dataBuffer, sizeof(short) * channels * scaleFactor, numSamplesToRead, in);
DebugLog(@"%d samples read", items);
DebugLog(@"Position in file is %d", ftell(in));
这将产生以下输出:
<main:(604)> Reading 29278208 samples of a total 115202048 samples of size 8, leaving 85923840 samples remaining
<main:(605)> Position in file is 512
<main:(607)> 448 samples read
<main:(608)> Position in file is 58560512
(有问题的文件大小为 225008K。)
那么我如何才能读取每个 8 字节的 448 个样本并从位置 512 移动到位置 58560512?为什么没有读取请求的数据量?