Partager via


SpWaveFormatEx BlockAlign property (SAPI 5.3)

Microsoft Speech API 5.3

Object: SpWaveFormatEx

BlockAlign Property

The BlockAlign property gets and sets the block alignment in bytes.

Syntax

Set: SpWaveFormatEx.BlockAlign = Integer
Get: Integer = SpWaveFormatEx.BlockAlign

Parts

  • SpWaveFormatEx
    The owning object.
  • Integer
    Set: An Integer variable that sets the property.
    Get: An Integer variable that gets the property.

Remarks

The block alignment is the minimum atomic unit of data for the FormatTag format type. If the FormatTag is WAVE_FORMAT_PCM, BlockAlign should be equal to the product of Channels and BitsPerSample divided by 8 (bits per byte). For non-PCM formats, this member must be computed according to the manufacturer's specification of the format tag.

Playback and record software handles audio data in blocks. The sizes of these blocks are multiples of the value of the BlockAlign property. Data written and read from a device must always start at the beginning of a block. For example, it is illegal to start playback of PCM data in the middle of a sample (that is, on a non-block-aligned boundary).

Example

For an example of the use of the BlockAlign property, see the code example in the SpAudioFormat GetWaveFormatEx section.