Class SignalGenerator
Signal Generator Sin, Square, Triangle, SawTooth, White Noise, Pink Noise, Sweep.
Inheritance
Inherited Members
Namespace: SIPSorcery.Media
Assembly: SIPSorcery.dll
Syntax
public class SignalGenerator
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
| Improve this Doc View SourceSignalGenerator()
Initializes a new instance for the Generator (Default :: 44.1Khz, 2 channels, Sinus, Frequency = 440, Gain = 1)
Declaration
public SignalGenerator()
SignalGenerator(Int32, Int32)
Initializes a new instance for the Generator (UserDef SampleRate & Channels)
Declaration
public SignalGenerator(int sampleRate, int channels)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | sampleRate | Desired sample rate |
System.Int32 | channels | Number of channels |
Properties
| Improve this Doc View SourceChannels
Declaration
public int Channels { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 |
Frequency
Frequency for the Generator. (20.0 - 20000.0 Hz) Sin, Square, Triangle, SawTooth, Sweep (Start Frequency).
Declaration
public double Frequency { get; set; }
Property Value
Type | Description |
---|---|
System.Double |
FrequencyEnd
End Frequency for the Sweep Generator. (Start Frequency in Frequency)
Declaration
public double FrequencyEnd { get; set; }
Property Value
Type | Description |
---|---|
System.Double |
FrequencyEndLog
Return Log of Frequency End (Read only)
Declaration
public double FrequencyEndLog { get; }
Property Value
Type | Description |
---|---|
System.Double |
FrequencyLog
Return Log of Frequency Start (Read only)
Declaration
public double FrequencyLog { get; }
Property Value
Type | Description |
---|---|
System.Double |
Gain
Gain for the Generator. (0.0 to 1.0)
Declaration
public double Gain { get; set; }
Property Value
Type | Description |
---|---|
System.Double |
PhaseReverse
Channel PhaseReverse
Declaration
public bool[] PhaseReverse { get; }
Property Value
Type | Description |
---|---|
System.Boolean[] |
SampleRate
Declaration
public int SampleRate { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 |
SweepLengthSecs
Length Seconds for the Sweep Generator.
Declaration
public double SweepLengthSecs { get; set; }
Property Value
Type | Description |
---|---|
System.Double |
Type
Type of Generator.
Declaration
public SignalGeneratorType Type { get; set; }
Property Value
Type | Description |
---|---|
SignalGeneratorType |
Methods
| Improve this Doc View SourceRead(Single[], Int32, Int32)
Reads from this provider.
Declaration
public int Read(float[] buffer, int offset, int count)
Parameters
Type | Name | Description |
---|---|---|
System.Single[] | buffer | |
System.Int32 | offset | |
System.Int32 | count |
Returns
Type | Description |
---|---|
System.Int32 |