C# Класс NAudio.Wave.WaveFormat

Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
averageBytesPerSecond int
bitsPerSample short
blockAlign short
channels short
extraSize short
sampleRate int
waveFormatTag WaveFormatEncoding

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

Метод Описание
ConvertLatencyToByteSize ( int milliseconds ) : int

Gets the size of a wave buffer equivalent to the latency in milliseconds.

CreateALawFormat ( int sampleRate, int channels ) : WaveFormat

Creates an A-law wave format

CreateCustomFormat ( WaveFormatEncoding tag, int sampleRate, int channels, int averageBytesPerSecond, int blockAlign, int bitsPerSample ) : WaveFormat

Creates a WaveFormat with custom members

CreateIeeeFloatWaveFormat ( int sampleRate, int channels ) : WaveFormat

Creates a new 32 bit IEEE floating point wave format

CreateMuLawFormat ( int sampleRate, int channels ) : WaveFormat

Creates a Mu-law wave format

Equals ( object obj ) : bool

Compares with another WaveFormat object

FromFormatChunk ( BinaryReader br, int formatChunkLength ) : WaveFormat

Reads in a WaveFormat (with extra data) from a fmt chunk (chunk identifier and length should already have been read)

GetHashCode ( ) : int

Provides a Hashcode for this WaveFormat

MarshalFromPtr ( IntPtr pointer ) : WaveFormat

Helper function to retrieve a WaveFormat structure from a pointer

MarshalToPtr ( WaveFormat format ) : IntPtr

Helper function to marshal WaveFormat to an IntPtr

Serialize ( BinaryWriter writer ) : void

Writes this WaveFormat object to a stream

ToString ( ) : string

Reports this WaveFormat as a string

WaveFormat ( ) : System

Creates a new PCM 44.1Khz stereo 16 bit format

WaveFormat ( BinaryReader br ) : System

Reads a new WaveFormat object from a stream

WaveFormat ( int sampleRate, int channels ) : System

Creates a new 16 bit wave format with the specified sample rate and channel count

WaveFormat ( int rate, int bits, int channels ) : System

Creates a new PCM format with the specified sample rate, bit depth and channels

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

Метод Описание
ReadWaveFormat ( BinaryReader br, int formatChunkLength ) : void

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

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

Gets the size of a wave buffer equivalent to the latency in milliseconds.
public ConvertLatencyToByteSize ( int milliseconds ) : int
milliseconds int The milliseconds.
Результат int

CreateALawFormat() публичный статический Метод

Creates an A-law wave format
public static CreateALawFormat ( int sampleRate, int channels ) : WaveFormat
sampleRate int Sample Rate
channels int Number of Channels
Результат WaveFormat

CreateCustomFormat() публичный статический Метод

Creates a WaveFormat with custom members
public static CreateCustomFormat ( WaveFormatEncoding tag, int sampleRate, int channels, int averageBytesPerSecond, int blockAlign, int bitsPerSample ) : WaveFormat
tag WaveFormatEncoding The encoding
sampleRate int Sample Rate
channels int Number of channels
averageBytesPerSecond int Average Bytes Per Second
blockAlign int Block Align
bitsPerSample int Bits Per Sample
Результат WaveFormat

CreateIeeeFloatWaveFormat() публичный статический Метод

Creates a new 32 bit IEEE floating point wave format
public static CreateIeeeFloatWaveFormat ( int sampleRate, int channels ) : WaveFormat
sampleRate int sample rate
channels int number of channels
Результат WaveFormat

CreateMuLawFormat() публичный статический Метод

Creates a Mu-law wave format
public static CreateMuLawFormat ( int sampleRate, int channels ) : WaveFormat
sampleRate int Sample Rate
channels int Number of Channels
Результат WaveFormat

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

Compares with another WaveFormat object
public Equals ( object obj ) : bool
obj object Object to compare to
Результат bool

FromFormatChunk() публичный статический Метод

Reads in a WaveFormat (with extra data) from a fmt chunk (chunk identifier and length should already have been read)
public static FromFormatChunk ( BinaryReader br, int formatChunkLength ) : WaveFormat
br System.IO.BinaryReader Binary reader
formatChunkLength int Format chunk length
Результат WaveFormat

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

Provides a Hashcode for this WaveFormat
public GetHashCode ( ) : int
Результат int

MarshalFromPtr() публичный статический Метод

Helper function to retrieve a WaveFormat structure from a pointer
public static MarshalFromPtr ( IntPtr pointer ) : WaveFormat
pointer System.IntPtr WaveFormat structure
Результат WaveFormat

MarshalToPtr() публичный статический Метод

Helper function to marshal WaveFormat to an IntPtr
public static MarshalToPtr ( WaveFormat format ) : IntPtr
format WaveFormat WaveFormat
Результат System.IntPtr

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

Writes this WaveFormat object to a stream
public Serialize ( BinaryWriter writer ) : void
writer System.IO.BinaryWriter the output stream
Результат void

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

Reports this WaveFormat as a string
public ToString ( ) : string
Результат string

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

Creates a new PCM 44.1Khz stereo 16 bit format
public WaveFormat ( ) : System
Результат System

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

Reads a new WaveFormat object from a stream
public WaveFormat ( BinaryReader br ) : System
br System.IO.BinaryReader A binary reader that wraps the stream
Результат System

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

Creates a new 16 bit wave format with the specified sample rate and channel count
public WaveFormat ( int sampleRate, int channels ) : System
sampleRate int Sample Rate
channels int Number of channels
Результат System

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

Creates a new PCM format with the specified sample rate, bit depth and channels
public WaveFormat ( int rate, int bits, int channels ) : System
rate int
bits int
channels int
Результат System

Описание свойств

averageBytesPerSecond защищенное свойство

for buffer estimation
protected int averageBytesPerSecond
Результат int

bitsPerSample защищенное свойство

number of bits per sample of mono data
protected short bitsPerSample
Результат short

blockAlign защищенное свойство

block size of data
protected short blockAlign
Результат short

channels защищенное свойство

number of channels
protected short channels
Результат short

extraSize защищенное свойство

number of following bytes
protected short extraSize
Результат short

sampleRate защищенное свойство

sample rate
protected int sampleRate
Результат int

waveFormatTag защищенное свойство

format type
protected WaveFormatEncoding waveFormatTag
Результат WaveFormatEncoding