WaveShaperNode.oversample

The oversample property of the WaveShaperNode interface is an enumerated value indicating if oversampling must be used. Oversampling is a technique for creating more samples (up-sampling) before applying a distortion effect to the audio signal.

Once applied, the number of samples is reduced to its initial numbers. This leads to better results by avoiding some aliasing, but comes at the expense of a lower precision shaping curve.

The possible oversample values are:

Value Effect
'none' Do not perform any oversampling.
'2x' Double the amount of samples before applying the shaping curve.
'4x' Multiply by 4 the amount of samples before applying the shaping curve.

Syntax

distortion.oversample = enumeratedValue;

Values

  • distortion is a WaveShaperNode.
  • enumeratedValue is one of 'none', '2x', or '4x'.

Example

See BaseAudioContext.createWaveShaper() for example code.

Specifications

Browser compatibility

Desktop Mobile
Chrome Edge Firefox Internet Explorer Opera Safari WebView Android Chrome Android Firefox for Android Opera Android Safari on IOS Samsung Internet
oversample
14
12
26
No
15
6
≤37
18
26
14
Yes
1.0

See also

© 2005–2021 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/WaveShaperNode/oversample