Partager via


Samples per Block (Windows Embedded CE 6.0)

1/6/2010

ACM codecs must handle multiples of the value in the wSamplesPerBlock member of the WAVEFORMATEX structure. This field is characteristic of the codec and should not be modified.

Internally, an ACM codec knows the number of blocks to encode or decode by the input size.

The ACM driver uses the wSamplesPerBlock member for format validation.

The wSamplesPerBlock member is read by casting a WAVEFORMATEX structure to one of the following structures:

  • WAVEFORMATEXTENSIBLE, defined in Mmreg.h
  • WAVEFORMATEX_PLUGG, defined by the Real-time Communications (RTC) Client API
  • Any locally defined structure that defines wSamplesPerBlock as the next WORD that follows immediately after the WAVEFORMATEX structure

The following code example shows a typical definition for a WAVEFORMATEX structure being used to convey samples per block.

typedef struct _WAVEFORMATEX_G711
{
   /* Generic WAVEFORMATEX fields */
   WAVEFORMATEX     WaveFormatEx;

   /* Number of samples per block */
   WORD             wSamplesPerBlock;
} WAVEFORMATEX_G711;

See Also

Concepts

Pluggable Codec Requirements