Table of Contents

Class WaveChannel32

Namespace
NAudio.Wave
Assembly
NAudio.Core.dll

Represents Channel for the WaveMixerStream 32 bit output and 16 bit input It's output is always stereo The input stream can be panned

public class WaveChannel32 : WaveStream, IDisposable, IAsyncDisposable, IWaveProvider, ISampleNotifier
Inheritance
WaveChannel32
Implements
Inherited Members
Extension Methods

Constructors

WaveChannel32(WaveStream)

Creates a WaveChannel32 with default settings

public WaveChannel32(WaveStream sourceStream)

Parameters

sourceStream WaveStream

The source stream

WaveChannel32(WaveStream, float, float)

Creates a new WaveChannel32

public WaveChannel32(WaveStream sourceStream, float volume, float pan)

Parameters

sourceStream WaveStream

the source stream

volume float

stream volume (1 is 0dB)

pan float

pan control (-1 to 1)

Properties

BlockAlign

Gets the block alignment for this WaveStream

public override int BlockAlign { get; }

Property Value

int

Length

Returns the stream length

public override long Length { get; }

Property Value

long

PadWithZeroes

If true, Read always returns the number of bytes requested

public bool PadWithZeroes { get; set; }

Property Value

bool

Pan

Pan of this channel (from -1 to 1)

public float Pan { get; set; }

Property Value

float

Position

Gets or sets the current position in the stream

public override long Position { get; set; }

Property Value

long

Volume

Volume of this channel. 1.0 = full scale

public float Volume { get; set; }

Property Value

float

WaveFormat

public override WaveFormat WaveFormat { get; }

Property Value

WaveFormat

Methods

Dispose(bool)

Disposes this WaveStream

protected override void Dispose(bool disposing)

Parameters

disposing bool

HasData(int)

Determines whether this channel has any data to play to allow optimisation to not read, but bump position forward

public override bool HasData(int count)

Parameters

count int

Returns

bool

Read(byte[], int, int)

Reads bytes from this wave stream

public override int Read(byte[] destBuffer, int offset, int numBytes)

Parameters

destBuffer byte[]

The destination buffer

offset int

Offset into the destination buffer

numBytes int

Number of bytes read

Returns

int

Number of bytes read.

Events

Sample

Sample

public event EventHandler<SampleEventArgs> Sample

Event Type

EventHandler<SampleEventArgs>