Skip to main content

PeriodicWave

The PeriodicWave interface defines a periodic waveform that can be used to shape the output of an OscillatorNode.

Constructor

constructor(context: BaseAudioContext, options: PeriodicWaveOptions)

PeriodicWaveOptions

ParameterTypeDefaultDescription
real
Optional
Float32Array-Cosine terms
imag
Optional
Float32Array-Sine terms
disableNormalizationbooleanfalseWhether the periodic wave is normalized or not.

Or by using BaseAudioContext factory method: BaseAudioContext.createPeriodicWave(real, imag, constraints?: PeriodicWaveConstraints)

Properties

None. PeriodicWave has no own or inherited properties.

Methods

None. PeriodicWave has no own or inherited methods.

Remarks

real and imag

  • if only one is specified, the other one is treated as array of 0s of the same length
  • if neither is given values are equivalent to the sine wave
  • if both given, they have to have the same length
  • to see how values corresponds to the output wave see for more information