SawTooth
View sourceSelects the native sawtooth waveform (0) for oscillator playback.
Enum
Numeric waveform choices for an AudioOscillator.
Set an oscillator’s type to one of these members to select the matching
native OscillatorNode waveform:
AudioOscillatorType.SawTooth selects sawtooth,
AudioOscillatorType.Sine selects sine,
AudioOscillatorType.Triangle selects triangle, and
AudioOscillatorType.Square selects square.
AudioOscillatorType.Sine is the default selected by the
AudioOscillator constructor.
The values are plain numbers. The constructor accepts and stores any
number, and AudioOscillator.validateSerial accepts any numeric
waveform value. If a number outside these members is used, playback throws
before an oscillator is created. Use one of these members for a waveform
value the playback path recognizes.
import { AudioOscillator, AudioOscillatorType } from '@wimaengine/audio'
const component = new AudioOscillator({ type: AudioOscillatorType.Square })
console.log(component.type) // 3; the oscillator produces a square waveform.Selects the native sawtooth waveform (0) for oscillator playback.
Selects the native sine waveform (1); the component default.
Selects the native triangle waveform (2) for oscillator playback.
Selects the native square waveform (3) for oscillator playback.