Class WaveChannel32
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, IAsyncDisposable, IDisposable, IWaveProvider, ISampleNotifier
- Inheritance
-
WaveChannel32
- Implements
- Inherited Members
- Extension Methods
Constructors
WaveChannel32(WaveStream)
Creates a WaveChannel32 with default settings
public WaveChannel32(WaveStream sourceStream)
Parameters
sourceStreamWaveStreamThe source stream
WaveChannel32(WaveStream, float, float)
Creates a new WaveChannel32
public WaveChannel32(WaveStream sourceStream, float volume, float pan)
Parameters
sourceStreamWaveStreamthe source stream
volumefloatstream volume (1 is 0dB)
panfloatpan control (-1 to 1)
Properties
BlockAlign
Gets the block alignment for this WaveStream
public override int BlockAlign { get; }
Property Value
Length
Returns the stream length
public override long Length { get; }
Property Value
PadWithZeroes
If true, Read always returns the number of bytes requested
public bool PadWithZeroes { get; set; }
Property Value
Pan
Pan of this channel (from -1 to 1)
public float Pan { get; set; }
Property Value
Position
Gets or sets the current position in the stream
public override long Position { get; set; }
Property Value
Volume
Volume of this channel. 1.0 = full scale
public float Volume { get; set; }
Property Value
WaveFormat
public override WaveFormat WaveFormat { get; }
Property Value
Methods
Dispose(bool)
Disposes this WaveStream
protected override void Dispose(bool disposing)
Parameters
disposingbool
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
countint
Returns
Read(byte[], int, int)
Reads bytes from this wave stream
public override int Read(byte[] destBuffer, int offset, int numBytes)
Parameters
Returns
Read(Span<byte>)
Reads bytes from this wave stream
public override int Read(Span<byte> destBuffer)
Parameters
Returns
- int
Number of bytes read.
Events
Sample
Sample
public event EventHandler<SampleEventArgs> Sample