还是没有深入主题,没有实际意义!
我在CSDN上找到一点资料:用直接得到每个采样点的数值(PCMWave 格式)
根据数值画线,哈哈!
哈哈!我把我写的,如何得到采样点数值程序给你看看
if (m_bOpen)
{
bool bDouble=(m_PCMWaveFmtRecord.wf.nChannels==2);
switch(m_PCMWaveFmtRecord.wf.nBlockAlign)
{
case 1:
WavVal = (unsigned int) *( (PBYTE)(pWaveStartCount) +i)-0x80;
break;
case 2:
{
WORD tmpVal= *((WORD*)(pWaveStartCount)+i);
if(m_PCMWaveFmtRecord.wf.nSamplesPerSec==8) WavVal=tmpVal-0x80;
case 4:
{
dwVal = *((DWORD*)(pWaveStartCount)+i);
if(bRight) dwVal>>=16;
WavVal=(int)(short)dwVal;
}
break;
case 8:
{
dwVal = *((DWORD*)(pWaveStartCount)+i);
if(bRight) dwVal>>=32;
dwVal|=0xffff0000;
WavVal=(int)(short)dwVal;
}
break;
default:
TRACE("Unknown format/n");
}
return WavVal;