C# 클래스 GSF.Media.WaveFormatChunk

Represents the format chunk in a WAVE media format file.
상속: RiffChunk, ISupportBinaryImage
파일 보기 프로젝트 열기: GridProtectionAlliance/gsf 1 사용 예제들

공개 메소드들

메소드 설명
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