C# Класс GSF.Media.WaveFormatChunk

Represents the format chunk in a WAVE media format file.
Наследование: RiffChunk, ISupportBinaryImage
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
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.

Приватные методы

Метод Описание
UpdateBlockAlignment ( ) : void
UpdateByteRate ( ) : void
WaveFormatChunk ( RiffChunk preRead, Stream source ) : System

Описание методов

CastSample() публичный Метод

Casts sample value to its equivalent native type based on defined BitsPerSample and AudioFormat.
public CastSample ( double sample ) : LittleBinaryValue
sample double Sample value.
Результат LittleBinaryValue

Clone() публичный Метод

Creates a copy of the WaveFormatChunk.
public Clone ( ) : WaveFormatChunk
Результат WaveFormatChunk

GenerateBinaryImage() публичный Метод

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.
Результат int

GetSampleTypeCode() публичный Метод

Determines sample data type code based on defined BitsPerSample and AudioFormat.
public GetSampleTypeCode ( ) : TypeCode
Результат TypeCode

ParseBinaryImage() публичный Метод

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 .
Результат int

WaveFormatChunk() публичный Метод

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 .
Результат System