OscillatorNode Class
A source of a periodic waveform (https://webaudio.github.io/web-audio-api/#OscillatorNode): a sine, square, sawtooth or triangle wave, or a PeriodicWave, band-limited to the Nyquist frequency.
public sealed class OscillatorNode : AudioScheduledSourceNode- Inheritance
AudioScheduledSourceNodeOscillatorNode
Constructors
| Name | Description |
|---|---|
| OscillatorNode(BaseAudioContext, OscillatorOptions?) | Creates an oscillator. |
OscillatorNode(BaseAudioContext, OscillatorOptions?)
OscillatorNode.csCreates an oscillator.
public OscillatorNode(BaseAudioContext context, OscillatorOptions? options = null)Parameters
contextBaseAudioContextoptionsOscillatorOptions?
Exceptions
DomException- The type is
customwithout periodic wave (anInvalidStateError).
See also
Properties
| Name | Description |
|---|---|
| Detune | Gets the detune in cents. |
| Frequency | Gets the frequency in Hz. |
| Type | Gets or sets the waveform. It cannot be set to OscillatorType.Custom: use OscillatorNode.SetPeriodicWave. |
Detune
OscillatorNode.csGets the detune in cents.
public AudioParam Detune { get; }Frequency
OscillatorNode.csGets or sets the waveform. It cannot be set to OscillatorType.Custom: use OscillatorNode.SetPeriodicWave.
public OscillatorType Type { get; set; }Property value
Exceptions
DomException- The value is
OscillatorType.Custom(anInvalidStateError).
See also
Methods
| Name | Description |
|---|---|
| SetPeriodicWave(PeriodicWave) | Sets a custom waveform: the type becomes OscillatorType.Custom. |
SetPeriodicWave(PeriodicWave)
OscillatorNode.csSets a custom waveform: the type becomes OscillatorType.Custom.
public void SetPeriodicWave(PeriodicWave periodicWave)