FQLab
A spectral audio sandbox
 
Loading...
Searching...
No Matches
FQLab.NAudioBufferedProvider Class Reference

Custom buffer for the NAudioPlayer. More...

Inheritance diagram for FQLab.NAudioBufferedProvider:
Inheritance graph
Collaboration diagram for FQLab.NAudioBufferedProvider:
Collaboration graph

Public Member Functions

 NAudioBufferedProvider (WaveFormat format)
 
void AddSamples (float[] samples)
 Allows external pipeline to add processed samples in queue for playback.
 
int Read (float[] buffer, int offset, int count)
 Gets data from the internal buffer based on the contract provided by NAudio.
 
void CompleteAdding ()
 

Properties

WaveFormat WaveFormat [get]
 Format of the audio stream.
 

Private Attributes

BlockingCollection< float > _sampleBuffer = new(128)
 Internal buffer which stores samples ready to be played by NAudioPlayer.
 

Detailed Description

Custom buffer for the NAudioPlayer.

Used to avoid conversion from float samples to bytes

Constructor & Destructor Documentation

◆ NAudioBufferedProvider()

FQLab.NAudioBufferedProvider.NAudioBufferedProvider ( WaveFormat  format)
inline

Member Function Documentation

◆ AddSamples()

void FQLab.NAudioBufferedProvider.AddSamples ( float[]  samples)
inline

Allows external pipeline to add processed samples in queue for playback.

Parameters
samples
Here is the caller graph for this function:

◆ CompleteAdding()

void FQLab.NAudioBufferedProvider.CompleteAdding ( )
Here is the caller graph for this function:

◆ Read()

int FQLab.NAudioBufferedProvider.Read ( float[]  buffer,
int  offset,
int  count 
)
inline

Gets data from the internal buffer based on the contract provided by NAudio.

Parameters
buffer
offset
count
Returns
Number of samples read.

Member Data Documentation

◆ _sampleBuffer

BlockingCollection<float> FQLab.NAudioBufferedProvider._sampleBuffer = new(128)
private

Internal buffer which stores samples ready to be played by NAudioPlayer.

Property Documentation

◆ WaveFormat

WaveFormat FQLab.NAudioBufferedProvider.WaveFormat
get

Format of the audio stream.


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