Table of Contents

Class SampleAggregator

Namespace
NAudio.Extras
Assembly
NAudio.Extras.dll

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

source ISampleProvider

source sample provider

fftLength int

FFT length, must be a power of 2

Properties

NotificationCount

Notification count, number of samples between MaximumCalculated events

public int NotificationCount { get; set; }

Property Value

int

PerformFFT

If true, performs an FFT on each block of samples

public bool PerformFFT { get; set; }

Property Value

bool

WaveFormat

Gets the WaveFormat of this Sample Provider

public WaveFormat WaveFormat { get; }

Property Value

WaveFormat

Methods

Read(Span<float>)

Reads samples from this sample provider

public int Read(Span<float> buffer)

Parameters

buffer Span<float>

Returns

int

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

EventHandler<FftEventArgs>

MaximumCalculated

Raised to indicate the maximum volume level in this period

public event EventHandler<MaxSampleEventArgs> MaximumCalculated

Event Type

EventHandler<MaxSampleEventArgs>