Class SignalGenerator
- Namespace
- NAudio.Wave.SampleProviders
- Assembly
- NAudio.Core.dll
Signal Generator Sin, Square, Triangle, SawTooth, White Noise, Pink Noise, Sweep.
public class SignalGenerator : ISampleProvider
- Inheritance
-
SignalGenerator
- Implements
- Inherited Members
- Extension Methods
Remarks
Posibility to change ISampleProvider Example :
WaveOut _waveOutGene = new WaveOut(); WaveGenerator wg = new SignalGenerator(); wg.Type = ... wg.Frequency = ... wg ... _waveOutGene.Init(wg); _waveOutGene.Play();
Constructors
SignalGenerator()
Initializes a new instance for the Generator (Default :: 44.1Khz, 2 channels, Sinus, Frequency = 440, Gain = 1)
public SignalGenerator()
SignalGenerator(int, int)
Initializes a new instance for the Generator (UserDef SampleRate & Channels)
public SignalGenerator(int sampleRate, int channel)
Parameters
Properties
Frequency
Frequency for the Generator. (20.0 - 20000.0 Hz) Sin, Square, Triangle, SawTooth, Sweep (Start Frequency).
public double Frequency { get; set; }
Property Value
FrequencyEnd
End Frequency for the Sweep Generator. (Start Frequency in Frequency)
public double FrequencyEnd { get; set; }
Property Value
FrequencyEndLog
Return Log of Frequency End (Read only)
public double FrequencyEndLog { get; }
Property Value
FrequencyLog
Return Log of Frequency Start (Read only)
public double FrequencyLog { get; }
Property Value
Gain
Gain for the Generator. (0.0 to 1.0)
public double Gain { get; set; }
Property Value
PhaseReverse
Channel PhaseReverse
public bool[] PhaseReverse { get; }
Property Value
- bool[]
SweepLengthSecs
Length Seconds for the Sweep Generator.
public double SweepLengthSecs { get; set; }
Property Value
Type
Type of Generator.
public SignalGeneratorType Type { get; set; }
Property Value
WaveFormat
The waveformat of this WaveProvider (same as the source)
public WaveFormat WaveFormat { get; }
Property Value
Methods
Read(Span<float>)
Reads from this provider.
public int Read(Span<float> buffer)