Class MultiplexingSampleProvider
- Namespace
- NAudio.Wave.SampleProviders
- Assembly
- NAudio.Core.dll
Allows any number of inputs to be patched to outputs Uses could include swapping left and right channels, turning mono into stereo, feeding different input sources to different soundcard outputs etc
public class MultiplexingSampleProvider : ISampleProvider
- Inheritance
-
MultiplexingSampleProvider
- Implements
- Inherited Members
- Extension Methods
Constructors
MultiplexingSampleProvider(IEnumerable<ISampleProvider>, int)
Creates a multiplexing sample provider, allowing re-patching of input channels to different output channels
public MultiplexingSampleProvider(IEnumerable<ISampleProvider> inputs, int numberOfOutputChannels)
Parameters
inputsIEnumerable<ISampleProvider>Input sample providers. Must all be of the same sample rate, but can have any number of channels
numberOfOutputChannelsintDesired number of output channels.
Properties
InputChannelCount
The number of input channels. Note that this is not the same as the number of input wave providers. If you pass in one stereo and one mono input provider, the number of input channels is three.
public int InputChannelCount { get; }
Property Value
OutputChannelCount
The number of output channels, as specified in the constructor.
public int OutputChannelCount { get; }
Property Value
WaveFormat
The output WaveFormat for this SampleProvider
public WaveFormat WaveFormat { get; }
Property Value
Methods
ConnectInputToOutput(int, int)
Connects a specified input channel to an output channel
public void ConnectInputToOutput(int inputChannel, int outputChannel)
Parameters
inputChannelintInput Channel index (zero based). Must be less than InputChannelCount
outputChannelintOutput Channel index (zero based). Must be less than OutputChannelCount
Read(Span<float>)
Reads samples from this sample provider
public int Read(Span<float> buffer)
Parameters
Returns
- int
Number of samples read