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
AudioScheduledSourceNode OscillatorNode

Constructors

NameDescription
OscillatorNode(BaseAudioContext, OscillatorOptions?)Creates an oscillator.

OscillatorNode(BaseAudioContext, OscillatorOptions?)

OscillatorNode.cs

Creates an oscillator.

public OscillatorNode(BaseAudioContext context, OscillatorOptions? options = null)

Parameters

context BaseAudioContext
options OscillatorOptions?

Exceptions

DomException
The type is custom without periodic wave (an InvalidStateError).

See also

Properties

NameDescription
DetuneGets the detune in cents.
FrequencyGets the frequency in Hz.
TypeGets or sets the waveform. It cannot be set to OscillatorType.Custom: use OscillatorNode.SetPeriodicWave.

Gets the detune in cents.

public AudioParam Detune { get; }

Gets the frequency in Hz.

public AudioParam Frequency { get; }

Gets or sets the waveform. It cannot be set to OscillatorType.Custom: use OscillatorNode.SetPeriodicWave.

public OscillatorType Type { get; set; }

Methods

NameDescription
SetPeriodicWave(PeriodicWave)Sets a custom waveform: the type becomes OscillatorType.Custom.

SetPeriodicWave(PeriodicWave)

OscillatorNode.cs

Sets a custom waveform: the type becomes OscillatorType.Custom.

public void SetPeriodicWave(PeriodicWave periodicWave)