Click or drag to resize

WaveFormatExtensible Class

Represents the "extensible" format structure for a WAVE media format file.
Inheritance Hierarchy
SystemObject
  GSF.MediaWaveFormatExtensible

Namespace: GSF.Media
Assembly: GSF.Media (in GSF.Media.dll) Version: 2.4.205-beta
Syntax
public class WaveFormatExtensible : ISupportBinaryImage
View Source

The WaveFormatExtensible type exposes the following members.

Constructors
 NameDescription
Public methodWaveFormatExtensible Creates a new WaveFormatExtensible.
Public methodWaveFormatExtensible(WaveFormatChunk) Creates a new WaveFormatExtensible object based on the WaveFormatChunk settings.
Public methodWaveFormatExtensible(UInt16, Speakers, Guid) Creates a new WaveFormatExtensible object based on the given settings.
Top
Properties
 NameDescription
Public propertyBinaryLength Gets the length of the binary representation of this WaveFormatExtensible instance.
Public propertyChannelMask Gets or sets flags representing spatial locations of data channels (i.e., speaker locations).
Public propertySampleValue Gets or sets sample value.
Public propertySubFormat Gets or sets Guid for sub-format type of extensible WaveFile.
Top
Methods
 NameDescription
Public methodEqualsDetermines whether the specified object is equal to the current object.
(Inherited from Object)
Protected methodFinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object)
Public methodGenerateBinaryImage Generates a binary representation of this WaveFormatExtensible and copies it into the given buffer.
Public methodGetHashCodeServes as the default hash function.
(Inherited from Object)
Public methodGetTypeGets the Type of the current instance.
(Inherited from Object)
Protected methodMemberwiseCloneCreates a shallow copy of the current Object.
(Inherited from Object)
Public methodParseBinaryImage Parses WaveFormatExtensible object by parsing the specified buffer containing a binary image.
Public methodToStringReturns a string that represents the current object.
(Inherited from Object)
Top
Fields
 NameDescription
Public fieldStatic memberFixedLength The fixed byte length of a WaveFormatExtensible instance.
Top
Extension Methods
 NameDescription
Public Extension MethodBinaryImage Returns a binary image of an object that implements ISupportBinaryImage.
(Defined by ISupportBinaryImageExtensions)
Public Extension MethodCopyBinaryImageToStream Copies binary image of object that implements ISupportBinaryImage to a Stream.
(Defined by ISupportBinaryImageExtensions)
Public Extension MethodCopyImage This is a common optimized block copy function for any kind of data.
(Defined by Common)
Public Extension MethodGetEnumValueOrDefault Gets the enumeration constant for value, if defined in the enumeration, or a default value.
(Defined by EnumExtensions)
Public Extension MethodGetEnumValueOrDefaultT Gets the enumeration constant for this value, if defined in the enumeration, or a default value.
(Defined by EnumExtensions)
Public Extension MethodParseBinaryImageFromStream Parses binary image of object that implements ISupportBinaryImage from a Stream.
(Defined by ISupportBinaryImageExtensions)
Top
Example
For some special bit-encodings you may need to use the "WaveFormatExtensible" audio format, here is an example of how to use that format:
C#
using System;
using GSF.Media;
using GSF.Media.Sound;

static class Program
{
    static void Main()
    {
        // Generate an 8000 Hz, 32 bits per sample, mono channeled WAVE file in "Extensible" format
        WaveFile waveFile = new WaveFile(8000, 32, 1, (ushort)WaveFormat.WaveFormatExtensible);

        // Apply the "WaveFormatExtensible" extra parameters
        WaveFormatExtensible extensible = new WaveFormatExtensible(waveFile.FormatChunk);
        waveFile.ExtraParameters = extensible.BinaryImage;

        // Generate the EBS Alert noise
        DTMF.Generate(waveFile, DTMF.EmergencyBroadcastSystemAlert, 0.25D);

        // Save the generated tone
        waveFile.Save("ExtensibleTest.wav");

        Console.Write("File available to be played from Windows Media Player...");
        Console.ReadKey();
    }
}
See Also