This documentation is archived and is not being maintained.

SpeechAudioFormatInfo::BlockAlign Property

Gets and sets the block alignment in bytes.

Namespace:  System.Speech.AudioFormat
Assembly:  System.Speech (in System.Speech.dll)

public:
property int BlockAlign {
	int get ();
}

Property Value

Type: System::Int32
An int containing the block alignment value.

Playback and record software handles audio data in blocks. The sizes of these blocks are multiples of the value of the BlockAlign property. Block alignment value is the number of bytes in an atomic unit (that is, a block) of audio for a particular format. For Pulse Code Modulation (PCM) formats, the formula for calculating block alignment is as follows:

  • Block Alignment = Bytes per Sample x Number of Channels

For example, the block alignment value for 16-bit PCM format mono audio is 2 (2 bytes per sample x 1 channel). For 16-bit PCM format stereo audio, the block alignment value is 4.

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 (meaning on a boundary that is not block-aligned).

.NET Framework

Supported in: 4, 3.5, 3.0

.NET Framework Client Profile

Supported in: 4

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
Show: