Class WaveFormatExtensible
WaveFormatExtensible http://www.microsoft.com/whdc/device/audio/multichaud.mspx
public class WaveFormatExtensible : WaveFormat
- Inheritance
-
WaveFormatExtensible
- Inherited Members
- Extension Methods
Constructors
WaveFormatExtensible(int, int, int, bool, int, Speakers)
Creates a new linear PCM or IEEE float WaveFormatExtensible with a strongly typed channel layout. See WaveFormatExtensible(int, int, int, bool, int, int) for details.
public WaveFormatExtensible(int rate, int bits, int channels, bool useIeeeFloat, int validBitsPerSample, Speakers channelMask)
Parameters
rateintSample rate
bitsintContainer bits per sample (block alignment is derived from this)
channelsintNumber of channels
useIeeeFloatboolTrue for IEEE float samples, false for integer PCM
validBitsPerSampleintNumber of valid bits per sample (may be less than
bits)channelMaskSpeakersSpeaker positions present in the stream
WaveFormatExtensible(int, int, int, bool, int, int)
Creates a new linear PCM or IEEE float WaveFormatExtensible, choosing the SubFormat
from useIeeeFloat. Use this convenience overload when you don't need
an arbitrary SubFormat GUID but still want control over valid bits and channel mask —
in particular it can create 32-bit integer PCM (useIeeeFloat false),
which the bit-depth-based constructor cannot.
public WaveFormatExtensible(int rate, int bits, int channels, bool useIeeeFloat, int validBitsPerSample, int channelMask)
Parameters
rateintSample rate
bitsintContainer bits per sample (block alignment is derived from this)
channelsintNumber of channels
useIeeeFloatboolTrue for IEEE float samples, false for integer PCM
validBitsPerSampleintNumber of valid bits per sample (may be less than
bits)channelMaskintChannel mask describing the speaker layout, or 0 if unspecified
WaveFormatExtensible(int, int, int, Guid, int, Speakers)
Creates a new WaveFormatExtensible with full control over the SubFormat, valid bits per sample and a strongly typed channel layout. See WaveFormatExtensible(int, int, int, Guid, int, int) for details.
public WaveFormatExtensible(int rate, int bits, int channels, Guid subFormat, int validBitsPerSample, Speakers channelMask)
Parameters
rateintSample rate
bitsintContainer bits per sample (block alignment is derived from this)
channelsintNumber of channels
subFormatGuidSubFormat GUID (e.g. one of AudioMediaSubtypes)
validBitsPerSampleintNumber of valid bits per sample (may be less than
bits)channelMaskSpeakersSpeaker positions present in the stream
WaveFormatExtensible(int, int, int, Guid, int, int)
Creates a new WaveFormatExtensible with full control over the SubFormat, valid bits per sample and channel mask. Use this overload when the convenience PCM/IEEE constructor's assumptions don't fit — for example to create 32-bit integer PCM (rather than IEEE float), to carry a container size that differs from the valid bit depth (e.g. 24 valid bits in a 32-bit container), or to preserve an explicit channel layout.
public WaveFormatExtensible(int rate, int bits, int channels, Guid subFormat, int validBitsPerSample, int channelMask)
Parameters
rateintSample rate
bitsintContainer bits per sample (block alignment is derived from this)
channelsintNumber of channels
subFormatGuidSubFormat GUID (e.g. one of AudioMediaSubtypes)
validBitsPerSampleintNumber of valid bits per sample (may be less than
bits)channelMaskintChannel mask describing the speaker layout, or 0 if unspecified
WaveFormatExtensible(int, int, int, int)
Creates a new WaveFormatExtensible for PCM or IEEE
public WaveFormatExtensible(int rate, int bits, int channels, int channelMask = 0)
Parameters
Properties
ChannelMask
The channel mask describing which speaker positions are present in the stream. Compare against the Speakers flags. Zero means no explicit layout was specified.
public int ChannelMask { get; }
Property Value
SubFormat
SubFormat (may be one of AudioMediaSubtypes)
public Guid SubFormat { get; }
Property Value
ValidBitsPerSample
The number of valid bits per sample. May be less than BitsPerSample when samples are stored in a larger container (e.g. 24 valid bits packed into a 32-bit container).
public int ValidBitsPerSample { get; }
Property Value
Methods
Serialize(BinaryWriter)
Serialize
public override void Serialize(BinaryWriter writer)
Parameters
writerBinaryWriter
ToStandardWaveFormat()
WaveFormatExtensible for PCM or floating point can be awkward to work with This creates a regular WaveFormat structure representing the same audio format Returns the WaveFormat unchanged for non PCM or IEEE float
public WaveFormat ToStandardWaveFormat()
Returns
ToString()
String representation
public override string ToString()