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
sourceISampleProviderSource sample provider
MeteringSampleProvider(ISampleProvider, int)
Initialises a new instance of MeteringSampleProvider
public MeteringSampleProvider(ISampleProvider source, int samplesPerNotification)
Parameters
sourceISampleProvidersource sampler provider
samplesPerNotificationintNumber of samples between notifications
Properties
SamplesPerNotification
Number of Samples per notification
public int SamplesPerNotification { get; set; }
Property Value
WaveFormat
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
- int
Number of samples read
Events
StreamVolume
Raised periodically to inform the user of the max volume
public event EventHandler<StreamVolumeEventArgs> StreamVolume