Table of Contents

Class MeteringSampleProvider

Namespace
NAudio.Wave.SampleProviders
Assembly
NAudio.Core.dll

Simple SampleProvider that passes through audio unchanged and raises an event every n samples with the maximum sample value from the period for metering purposes

public class MeteringSampleProvider : ISampleProvider
Inheritance
MeteringSampleProvider
Implements
Inherited Members
Extension Methods

Constructors

MeteringSampleProvider(ISampleProvider)

Initialises a new instance of MeteringSampleProvider that raises 10 stream volume events per second

public MeteringSampleProvider(ISampleProvider source)

Parameters

source ISampleProvider

Source sample provider

MeteringSampleProvider(ISampleProvider, int)

Initialises a new instance of MeteringSampleProvider

public MeteringSampleProvider(ISampleProvider source, int samplesPerNotification)

Parameters

source ISampleProvider

source sampler provider

samplesPerNotification int

Number of samples between notifications

Properties

SamplesPerNotification

Number of Samples per notification

public int SamplesPerNotification { get; set; }

Property Value

int

WaveFormat

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>

Sample buffer

Returns

int

Number of samples read

Events

StreamVolume

Raised periodically to inform the user of the max volume

public event EventHandler<StreamVolumeEventArgs> StreamVolume

Event Type

EventHandler<StreamVolumeEventArgs>