首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > C++ Builder >

cannot convert `WAVEFORMATEXTENSIBLE*' to `tWAVEFORMATEX*',该如何解决

2012-02-16 
cannot convert `WAVEFORMATEXTENSIBLE* to `tWAVEFORMATEX*wfex.Format.wFormatTag WAVE_FORMAT_EXTE

cannot convert `WAVEFORMATEXTENSIBLE*' to `tWAVEFORMATEX*'
wfex.Format.wFormatTag = WAVE_FORMAT_EXTENSIBLE;
wfex.Format.nChannels = g.s.dxOutChan;
wfex.Format.nBlockAlign = (g.s.dxOutChan * g.s.dxOutBitSiz) / 8;
wfex.Format.nSamplesPerSec = g.s.SAMPLE_RATE;
wfex.Format.nAvgBytesPerSec = wfex.Format.nSamplesPerSec * wfex.Format.nBlockAlign;
wfex.Format.wBitsPerSample = g.s.dxOutBitSiz;
wfex.Format.cbSize = 22;
wfex.Samples.wValidBitsPerSample = g.s.dxOutBitSiz;
wfex.dwChannelMask = SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT;
wfex.SubFormat = KSDATAFORMAT_SUBTYPE_PCM;

 

dsbd.dwSize = sizeof(DSBUFFERDESC);
dsbd.dwFlags = DSBCAPS_GLOBALFOCUS | DSBCAPS_GETCURRENTPOSITION2;
dsbd.dwFlags |= DSBCAPS_CTRLPOSITIONNOTIFY;
dsbd.dwBufferBytes = iFrameSize * g.s.dxOutBytSiz * NBLOCKS;
dsbd.lpwfxFormat = &wfex;

报错:

cannot convert `WAVEFORMATEXTENSIBLE*' to `tWAVEFORMATEX*' in assignment

怎么解决啊??

[解决办法]
看出错是哪行,可能是等号左右的类型不对

热点排行