Table of Contents

Class WaveProvider32

Namespace
NAudio.Wave
Assembly
NAudio.Core.dll

Base class for creating a 32 bit floating point wave provider Can also be used as a base class for an ISampleProvider that can be plugged straight into anything requiring an IWaveProvider

public abstract class WaveProvider32 : IWaveProvider, ISampleProvider
Inheritance
WaveProvider32
Implements
Inherited Members
Extension Methods

Constructors

WaveProvider32()

Initializes a new instance of the WaveProvider32 class defaulting to 44.1kHz mono

public WaveProvider32()

WaveProvider32(int, int)

Initializes a new instance of the WaveProvider32 class with the specified sample rate and number of channels

public WaveProvider32(int sampleRate, int channels)

Parameters

sampleRate int
channels int

Properties

WaveFormat

The Wave Format

public WaveFormat WaveFormat { get; }

Property Value

WaveFormat

Methods

Read(byte[], int, int)

Implements the Read method of IWaveProvider by delegating to the abstract Read method taking a float array

public int Read(byte[] buffer, int offset, int count)

Parameters

buffer byte[]
offset int
count int

Returns

int

Read(float[], int, int)

Method to override in derived classes Supply the requested number of samples into the buffer

public abstract int Read(float[] buffer, int offset, int sampleCount)

Parameters

buffer float[]
offset int
sampleCount int

Returns

int

SetWaveFormat(int, int)

Allows you to specify the sample rate and channels for this WaveProvider (should be initialised before you pass it to a wave player)

public void SetWaveFormat(int sampleRate, int channels)

Parameters

sampleRate int
channels int