C# Class NAudio.Wave.WaveFormat

Afficher le fichier Open project: jishi/Jishi.StreamToSonos Class Usage Examples

Protected Properties

Свойство Type Description
averageBytesPerSecond int
bitsPerSample short
blockAlign short
channels short
extraSize short
sampleRate int
waveFormatTag WaveFormatEncoding

Méthodes publiques

Méthode Description
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

Private Methods

Méthode Description
ReadWaveFormat ( BinaryReader br, int formatChunkLength ) : void

Method Details

ConvertLatencyToByteSize() public méthode

Gets the size of a wave buffer equivalent to the latency in milliseconds.
public ConvertLatencyToByteSize ( int milliseconds ) : int
milliseconds int The milliseconds.
Résultat int

CreateALawFormat() public static méthode

Creates an A-law wave format
public static CreateALawFormat ( int sampleRate, int channels ) : WaveFormat
sampleRate int Sample Rate
channels int Number of Channels
Résultat WaveFormat

CreateCustomFormat() public static méthode

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
Résultat WaveFormat

CreateIeeeFloatWaveFormat() public static méthode

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
Résultat WaveFormat

CreateMuLawFormat() public static méthode

Creates a Mu-law wave format
public static CreateMuLawFormat ( int sampleRate, int channels ) : WaveFormat
sampleRate int Sample Rate
channels int Number of Channels
Résultat WaveFormat

Equals() public méthode

Compares with another WaveFormat object
public Equals ( object obj ) : bool
obj object Object to compare to
Résultat bool

FromFormatChunk() public static méthode

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
Résultat WaveFormat

GetHashCode() public méthode

Provides a Hashcode for this WaveFormat
public GetHashCode ( ) : int
Résultat int

MarshalFromPtr() public static méthode

Helper function to retrieve a WaveFormat structure from a pointer
public static MarshalFromPtr ( IntPtr pointer ) : WaveFormat
pointer System.IntPtr WaveFormat structure
Résultat WaveFormat

MarshalToPtr() public static méthode

Helper function to marshal WaveFormat to an IntPtr
public static MarshalToPtr ( WaveFormat format ) : IntPtr
format WaveFormat WaveFormat
Résultat System.IntPtr

Serialize() public méthode

Writes this WaveFormat object to a stream
public Serialize ( BinaryWriter writer ) : void
writer System.IO.BinaryWriter the output stream
Résultat void

ToString() public méthode

Reports this WaveFormat as a string
public ToString ( ) : string
Résultat string

WaveFormat() public méthode

Creates a new PCM 44.1Khz stereo 16 bit format
public WaveFormat ( ) : System
Résultat System

WaveFormat() public méthode

Reads a new WaveFormat object from a stream
public WaveFormat ( BinaryReader br ) : System
br System.IO.BinaryReader A binary reader that wraps the stream
Résultat System

WaveFormat() public méthode

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
Résultat System

WaveFormat() public méthode

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
Résultat System

Property Details

averageBytesPerSecond protected_oe property

for buffer estimation
protected int averageBytesPerSecond
Résultat int

bitsPerSample protected_oe property

number of bits per sample of mono data
protected short bitsPerSample
Résultat short

blockAlign protected_oe property

block size of data
protected short blockAlign
Résultat short

channels protected_oe property

number of channels
protected short channels
Résultat short

extraSize protected_oe property

number of following bytes
protected short extraSize
Résultat short

sampleRate protected_oe property

sample rate
protected int sampleRate
Résultat int

waveFormatTag protected_oe property

format type
protected WaveFormatEncoding waveFormatTag
Résultat WaveFormatEncoding