char wavHeader[44]; //用来保存头部44字节 sfile.read(wavHeader, sizeof(wavHeader)); //将文件头44字节保存到wavHeader数组中 int width = *(ushort *)(wavHeader + 34); //将量化样本(本文件是16bit)数据赋值到width变量 int dataSize = sfile.size() - 44; //去除头部44字节后数据大小 int step = dataSize / maxSampleNum;