Xeno-rat
Loading...
Searching...
No Matches
NAudio.Wave.MultiplexingWaveProvider Class Reference

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. More...

Inheritance diagram for NAudio.Wave.MultiplexingWaveProvider:
Collaboration diagram for NAudio.Wave.MultiplexingWaveProvider:

Public Member Functions

 MultiplexingWaveProvider (IEnumerable< IWaveProvider > inputs)
 Creates a multiplexing wave provider, allowing re-patching of input channels to different output channels. Number of outputs is equal to total number of channels in inputs.
 
 MultiplexingWaveProvider (IEnumerable< IWaveProvider > inputs, int numberOfOutputChannels)
 Creates a multiplexing wave provider, allowing re-patching of input channels to different output channels.
 
int Read (byte[] buffer, int offset, int count)
 Reads audio data from the input buffer and writes it to the output buffer.
 
void ConnectInputToOutput (int inputChannel, int outputChannel)
 Connects the input channel to the output channel.
 

Properties

WaveFormat WaveFormat [get]
 The WaveFormat of this WaveProvider.
 
int InputChannelCount [get]
 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.
 
int OutputChannelCount [get]
 The number of output channels, as specified in the constructor.
 
- Properties inherited from NAudio.Wave.IWaveProvider

Private Attributes

readonly IList< IWaveProviderinputs
 
readonly int outputChannelCount
 
readonly int inputChannelCount
 
readonly List< int > mappings
 
readonly int bytesPerSample
 
byte[] inputBuffer
 persistent temporary buffer to prevent creating work for garbage collector
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ MultiplexingWaveProvider() [1/2]

NAudio.Wave.MultiplexingWaveProvider.MultiplexingWaveProvider ( IEnumerable< IWaveProvider > inputs)
inline

Creates a multiplexing wave provider, allowing re-patching of input channels to different output channels. Number of outputs is equal to total number of channels in inputs.

Parameters
inputsInput wave providers. Must all be of the same format, but can have any number of channels

◆ MultiplexingWaveProvider() [2/2]

NAudio.Wave.MultiplexingWaveProvider.MultiplexingWaveProvider ( IEnumerable< IWaveProvider > inputs,
int numberOfOutputChannels )
inline

Creates a multiplexing wave provider, allowing re-patching of input channels to different output channels.

Parameters
inputsInput wave providers. Must all be of the same format, but can have any number of channels
numberOfOutputChannelsDesired number of output channels. (-1 means use total number of input channels)
Here is the call graph for this function:

Member Function Documentation

◆ ConnectInputToOutput()

void NAudio.Wave.MultiplexingWaveProvider.ConnectInputToOutput ( int inputChannel,
int outputChannel )
inline

Connects the input channel to the output channel.

Parameters
inputChannelThe input channel to be connected.
outputChannelThe output channel to be connected.
Exceptions
ArgumentExceptionThrown when the input channel or output channel is invalid.

◆ Read()

int NAudio.Wave.MultiplexingWaveProvider.Read ( byte[] buffer,
int offset,
int count )
inline

Reads audio data from the input buffer and writes it to the output buffer.

Parameters
bufferThe output buffer to write the audio data to.
offsetThe offset in the output buffer to start writing the data.
countThe number of bytes to read from the input buffer and write to the output buffer.
Returns
The number of sample frames read and written to the output buffer.

This method reads audio data from all input sources, even if the data is not needed, to keep them in sync. It then processes the input data and writes it to the output buffer based on the specified offset and count. The method modifies the output buffer in place.

Implements NAudio.Wave.IWaveProvider.

Here is the call graph for this function:

Member Data Documentation

◆ bytesPerSample

readonly int NAudio.Wave.MultiplexingWaveProvider.bytesPerSample
private

◆ inputBuffer

byte [] NAudio.Wave.MultiplexingWaveProvider.inputBuffer
private

persistent temporary buffer to prevent creating work for garbage collector

◆ inputChannelCount

readonly int NAudio.Wave.MultiplexingWaveProvider.inputChannelCount
private

◆ inputs

readonly IList<IWaveProvider> NAudio.Wave.MultiplexingWaveProvider.inputs
private

◆ mappings

readonly List<int> NAudio.Wave.MultiplexingWaveProvider.mappings
private

◆ outputChannelCount

readonly int NAudio.Wave.MultiplexingWaveProvider.outputChannelCount
private

Property Documentation

◆ InputChannelCount

int NAudio.Wave.MultiplexingWaveProvider.InputChannelCount
get

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.

◆ OutputChannelCount

int NAudio.Wave.MultiplexingWaveProvider.OutputChannelCount
get

The number of output channels, as specified in the constructor.

◆ WaveFormat

WaveFormat NAudio.Wave.MultiplexingWaveProvider.WaveFormat
get

The WaveFormat of this WaveProvider.

Implements NAudio.Wave.IWaveProvider.


The documentation for this class was generated from the following file: