C# Class GSF.Media.WaveFormatChunk

Represents the format chunk in a WAVE media format file.
Inheritance: RiffChunk, ISupportBinaryImage
Afficher le fichier Open project: GridProtectionAlliance/gsf Class Usage Examples

Méthodes publiques

Méthode Description
CastSample ( double sample ) : LittleBinaryValue

Casts sample value to its equivalent native type based on defined BitsPerSample and AudioFormat.

Clone ( ) : WaveFormatChunk

Creates a copy of the WaveFormatChunk.

GenerateBinaryImage ( byte buffer, int startIndex ) : int

Generates a binary representation of this WaveFormatChunk and copies it into the given buffer.

GetSampleTypeCode ( ) : TypeCode

Determines sample data type code based on defined BitsPerSample and AudioFormat.

ParseBinaryImage ( byte buffer, int startIndex, int length ) : int

Parses WaveFormatChunk object by parsing the specified buffer containing a binary image.

WaveFormatChunk ( int sampleRate, short bitsPerSample, short channels, ushort audioFormat ) : System

Constructs a new WaveFormatChunk using the specified audio parameters.

Private Methods

Méthode Description
UpdateBlockAlignment ( ) : void
UpdateByteRate ( ) : void
WaveFormatChunk ( RiffChunk preRead, Stream source ) : System

Method Details

CastSample() public méthode

Casts sample value to its equivalent native type based on defined BitsPerSample and AudioFormat.
public CastSample ( double sample ) : LittleBinaryValue
sample double Sample value.
Résultat LittleBinaryValue

Clone() public méthode

Creates a copy of the WaveFormatChunk.
public Clone ( ) : WaveFormatChunk
Résultat WaveFormatChunk

GenerateBinaryImage() public méthode

Generates a binary representation of this WaveFormatChunk and copies it into the given buffer.
is null. /// or is less than 0 -or- /// and will exceed length. ///
public GenerateBinaryImage ( byte buffer, int startIndex ) : int
buffer byte Buffer used to hold generated binary image of the source object.
startIndex int 0-based starting index in the to start writing.
Résultat int

GetSampleTypeCode() public méthode

Determines sample data type code based on defined BitsPerSample and AudioFormat.
public GetSampleTypeCode ( ) : TypeCode
Résultat TypeCode

ParseBinaryImage() public méthode

Parses WaveFormatChunk object by parsing the specified buffer containing a binary image.
WAVE format section too small, wave file corrupted. is null. /// or is less than 0 -or- /// and will exceed length. ///
public ParseBinaryImage ( byte buffer, int startIndex, int length ) : int
buffer byte Buffer containing binary image to parse.
startIndex int 0-based starting index in the to start parsing.
length int Valid number of bytes within from .
Résultat int

WaveFormatChunk() public méthode

Constructs a new WaveFormatChunk using the specified audio parameters.
Invalid bit rate specified - wave file bit rates must be a multiple of 8.
public WaveFormatChunk ( int sampleRate, short bitsPerSample, short channels, ushort audioFormat ) : System
sampleRate int Sample rate for the .
bitsPerSample short Bits per sample for the .
channels short Audio channels for the .
audioFormat ushort Audio format for the .
Résultat System