WaveShaperNode

この記事はまだ日本語に翻訳されていません。MDN の翻訳はボランティアによって行われています。是非 MDN に登録し、私たちの力になって下さい。

« Web Audio API

This is an experimental technology
Because this technology's specification has not stabilized, check the compatibility table for the proper prefixes to use in various browsers. Also note that the syntax and behavior of an experimental technology is subject to change in future versions of browsers as the spec changes.

The WaveShaperNode interface represents a non-linear distorter. It is an AudioNode that use a curve to apply a waveshaping distortion to the signal. Beside obvious distortion effects, it is often used to add a warm feeling to the signal. A WaveShaperNode always has exactly one input and one output.

  • Number of inputs 1
  • Number of outputs 1
  • Channel count mode "max"
  • Channel count 2 (not used in the default count mode)
  • Channel interpretation "speakers"

Properties

Inherits properties from its parent, AudioNode.

WaveShaperNode.curve
Is a Float32Array of numbers describing the distortion to apply. The mid-element of the array is applied to any signal value of 0, the first to signal values of -1 and the last to signal values of 1; values lower than -1 or greater than 1 are treated like -1 or 1 respectively. If necessary, intermediate values of the distortion curve are linearly interpolated. The array can be a null value: in that case, no distortion is applied to the input signal.
WaveShaperNode.oversample
Is an enumerated values indicating if oversampling must be used. Oversampling is a technique creating more samples (up-sampling) before to apply the distortion effect. Once applied, the number of samples is reduced to its initial numbers. This leads to better results, avoiding some aliasing, at the expense of the precision of the shaping curve. The possible 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.

 

Methods

No specific method; inherits methods from its parent, AudioNode.

Examples

 

Specifications

Specification Status Comment
Web Audio API Working Draft  

Browser compatibility

Feature Chrome Firefox (Gecko) Internet Explorer Opera Safari (WebKit)
Basic support (Yes)webkit Activated on Nightly only Not supported Not supported ?
Feature Android Firefox Mobile (Gecko) IE Phone Opera Mobile Safari Mobile
Basic support Not supported Activated on Nightly only Not supported Not supported ?

See also

  • Using Web Audio

Document Tags and Contributors

Contributors to this page: Reachmeatshivam, teoli
最終更新者: Reachmeatshivam,