Class SampleAggregator
Demo sample provider that performs FFTs
public class SampleAggregator : ISampleProvider
- Inheritance
-
SampleAggregator
- Implements
- Inherited Members
Constructors
SampleAggregator(ISampleProvider, int)
Creates a new SampleAggregator
public SampleAggregator(ISampleProvider source, int fftLength = 1024)
Parameters
sourceISampleProvidersource sample provider
fftLengthintFFT length, must be a power of 2
Properties
NotificationCount
Notification count, number of samples between MaximumCalculated events
public int NotificationCount { get; set; }
Property Value
PerformFFT
If true, performs an FFT on each block of samples
public bool PerformFFT { get; set; }
Property Value
WaveFormat
Gets the WaveFormat of this Sample Provider
public WaveFormat WaveFormat { get; }
Property Value
Methods
Read(Span<float>)
Reads samples from this sample provider
public int Read(Span<float> buffer)
Parameters
Returns
Reset()
Reset the volume calculation
public void Reset()
Events
FftCalculated
Raised to indicate that a block of samples has had an FFT performed on it
public event EventHandler<FftEventArgs> FftCalculated
Event Type
MaximumCalculated
Raised to indicate the maximum volume level in this period
public event EventHandler<MaxSampleEventArgs> MaximumCalculated