Click here to Skip to main content
15,887,434 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
C++
WAVEFORMATEX in_wfx;
in_wfx.wFormatTag = WAVE_FORMAT_PCM;
in_wfx.nChannels =1;
in_wfx.nSamplesPerSec =8000;
in_wfx.nAvgBytesPerSec =16000;
in_wfx.nBlockAlign =2;
in_wfx.wBitsPerSample =16;
in_wfx.cbSize = 0;



how to convert above form to bellow form?

C++
WAVEFORMATEX out_wfx;
out_wfx.wFormatTag = WAVE_FORMAT_PCM;
out_wfx.nChannels =1;
out_wfx.nSamplesPerSec =8000;
out_wfx.nAvgBytesPerSec =8000;
out_wfx.nBlockAlign =1;
out_wfx.wBitsPerSample =8;
out_wfx.cbSize = 0;
Posted
Updated 29-Apr-10 22:46pm
v3

1 solution

Dear,

In this case, you have to drop lower byte of 16bit PCM sample. Also this is related with endian.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900