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

Utility class that takes an IWaveProvider input at any bit depth and exposes it as an ISampleProvider. Can turn mono inputs into stereo, and allows adjusting of volume (The eventual successor to WaveChannel32) This class also serves as an example of how you can link together several simple Sample Providers to form a more useful class. More...

Inheritance diagram for NAudio.Wave.SampleProviders.SampleChannel:
Collaboration diagram for NAudio.Wave.SampleProviders.SampleChannel:

Public Member Functions

 SampleChannel (IWaveProvider waveProvider)
 Initialises a new instance of SampleChannel.
 
 SampleChannel (IWaveProvider waveProvider, bool forceStereo)
 Initialises a new instance of SampleChannel.
 
int Read (float[] buffer, int offset, int sampleCount)
 Reads audio samples from the volume provider and stores them in the buffer starting at the specified offset.
 

Properties

WaveFormat WaveFormat [get]
 The WaveFormat of this Sample Provider.
 
float Volume [get, set]
 Allows adjusting the volume, 1.0f = full volume.
 
EventHandler< StreamVolumeEventArgsPreVolumeMeter
 Raised periodically to inform the user of the max volume (before the volume meter)
 
- Properties inherited from NAudio.Wave.ISampleProvider

Private Attributes

readonly VolumeSampleProvider volumeProvider
 
readonly MeteringSampleProvider preVolumeMeter
 
readonly WaveFormat waveFormat
 

Detailed Description

Utility class that takes an IWaveProvider input at any bit depth and exposes it as an ISampleProvider. Can turn mono inputs into stereo, and allows adjusting of volume (The eventual successor to WaveChannel32) This class also serves as an example of how you can link together several simple Sample Providers to form a more useful class.

Constructor & Destructor Documentation

◆ SampleChannel() [1/2]

NAudio.Wave.SampleProviders.SampleChannel.SampleChannel ( IWaveProvider waveProvider)
inline

Initialises a new instance of SampleChannel.

Parameters
waveProviderSource wave provider, must be PCM or IEEE

◆ SampleChannel() [2/2]

NAudio.Wave.SampleProviders.SampleChannel.SampleChannel ( IWaveProvider waveProvider,
bool forceStereo )
inline

Initialises a new instance of SampleChannel.

Parameters
waveProviderSource wave provider, must be PCM or IEEE
forceStereoforce mono inputs to become stereo
Here is the call graph for this function:

Member Function Documentation

◆ Read()

int NAudio.Wave.SampleProviders.SampleChannel.Read ( float[] buffer,
int offset,
int sampleCount )
inline

Reads audio samples from the volume provider and stores them in the buffer starting at the specified offset.

Parameters
bufferThe array to store the audio samples.
offsetThe zero-based index in buffer at which to begin storing the samples.
sampleCountThe number of audio samples to read.
Returns
The total number of samples read into the buffer.

Implements NAudio.Wave.ISampleProvider.

Here is the call graph for this function:

Member Data Documentation

◆ preVolumeMeter

readonly MeteringSampleProvider NAudio.Wave.SampleProviders.SampleChannel.preVolumeMeter
private

◆ volumeProvider

readonly VolumeSampleProvider NAudio.Wave.SampleProviders.SampleChannel.volumeProvider
private

◆ waveFormat

readonly WaveFormat NAudio.Wave.SampleProviders.SampleChannel.waveFormat
private

Property Documentation

◆ PreVolumeMeter

EventHandler<StreamVolumeEventArgs> NAudio.Wave.SampleProviders.SampleChannel.PreVolumeMeter
addremove

Raised periodically to inform the user of the max volume (before the volume meter)

◆ Volume

float NAudio.Wave.SampleProviders.SampleChannel.Volume
getset

Allows adjusting the volume, 1.0f = full volume.

◆ WaveFormat

WaveFormat NAudio.Wave.SampleProviders.SampleChannel.WaveFormat
get

The WaveFormat of this Sample Provider.

Implements NAudio.Wave.ISampleProvider.


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