Link to home
Start Free TrialLog in
Avatar of WxW
WxW

asked on

WAV Compression

I used this call to open a MM handle for sample recording

WAVEFORMATEX wINEX;
WAVEIN wIN;

   wINEX.wFormatTag = WAVE_FORMAT_PCM;
      wINEX.nChannels = 2;
      wINEX.nSamplesPerSec = 16000;
      wINEX.wBitsPerSample = 8; //  8,16
      wINEX.nBlockAlign = (wINEX.wBitsPerSample * wINEX.nChannels) / 8;
      wINEX.nAvgBytesPerSec = wINEX.nSamplesPerSec * wINEX.nBlockAlign;
      wINEX.cbSize = 0;

      f = waveInOpen(
                  &wIN,
                  WAVE_MAPPER,
                  &wINEX,
                  (unsigned long)waveInProc,
                  0,
                  CALLBACK_FUNCTION);

I decided to use ADPCM for a better compression , but if I select WAVE_FORMAT_ADPCM to wFormatTag , the waveInOpen returns an error code : 32 . What's happening ?

And of course , if you have a suggestion for a better compression , tell me .

Thanks
ASKER CERTIFIED SOLUTION
Avatar of chensu
chensu
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of WxW
WxW

ASKER

Thanks chensu . But tell me . 1st. How I calculate the variables of WAVEFORMATEX because when specifying for example 8000 hz , it is not working . 2nd From where I get the extra bytes values ?
You can find the specification in MSDN Library on MSDN CDs or online (http://www.microsoft.com/msdn).

Microsoft Developer Network\Tools and Technologies\Multimedia Standards Update\New Multimedia\Document\Data Types and Data Techniques\New WAVE Types