Table of Contents

Class OscillatorNode

Namespace
CSharpToJavaScript.APIs.JS
Assembly
CSharpToJavaScript.dll

The OscillatorNode interface represents a periodic waveform, such as a sine wave. It is an AudioScheduledSourceNode audio-processing module that causes a specified frequency of a given wave to be created—in effect, a constant tone.

[Value("OscillatorNode")]
public class OscillatorNode : AudioScheduledSourceNode
Inheritance
OscillatorNode
Inherited Members

Remarks

Constructors

OscillatorNode()

public OscillatorNode()

OscillatorNode(BaseAudioContext, OscillatorOptions)

The OscillatorNode() constructor of the Web Audio API creates a new
OscillatorNode object which is an AudioNode that
represents a periodic waveform, like a sine wave, optionally setting the node's
properties' values to match values in a specified object.

public OscillatorNode(BaseAudioContext context, OscillatorOptions options = null)

Parameters

context BaseAudioContext
options OscillatorOptions

Remarks

If the default values of the properties are acceptable, you can optionally use the
CreateOscillator() factory method instead; see
Creating an AudioNode.

See also on MDN

Properties

Detune

The detune property of the OscillatorNode interface is an a-rate AudioParam representing detuning of oscillation in cents.

[Value("detune")]
public AudioParam Detune { get; }

Property Value

AudioParam

An a-rate AudioParam.

Remarks

NOTE

Though the AudioParam returned is read-only, the value it represents is not.

-Using the Web Audio API

See also on MDN

Frequency

The frequency property of the OscillatorNode interface is an a-rate AudioParam representing the frequency of oscillation in hertz.

[Value("frequency")]
public AudioParam Frequency { get; }

Property Value

AudioParam

An a-rate AudioParam.

Remarks

NOTE

Though the AudioParam returned is read-only, the value it represents is not.

-Using the Web Audio API

See also on MDN

Type

The type property of the OscillatorNode interface specifies what shape of waveform the
oscillator will output. There are several common waveforms available, as well as an
option to specify a custom waveform shape. The shape of the waveform will affect the
tone that is produced.

[Value("type")]
public OscillatorType Type { get; set; }

Property Value

OscillatorType

A string specifying the shape of oscillator wave. The different
available values are:Also see different oscillator node types for a visualization of the different waveform shapes.

Remarks

Methods

SetPeriodicWave(PeriodicWave)

The setPeriodicWave() method of the OscillatorNode interface is used to point to a PeriodicWave
defining a periodic waveform that can be used to shape the oscillator's output, when
Type is custom.

[Value("setPeriodicWave")]
public GlobalObject.Undefined SetPeriodicWave(PeriodicWave periodicWave)

Parameters

periodicWave PeriodicWave

Returns

GlobalObject.Undefined

None (GlobalObject.Undefined).

Remarks