WaveShaperNode.curve
Baseline Widely available
This feature is well established and works across many devices and browser versions. It’s been available across browsers since April 2021.
WaveShaperNode
接口的 curve
属性是一个描述要被应用的畸变的Float32Array
数组。
数组的中间元素被应用于每个信号数值 0
,第一个应用于信号数值 -1
,最后一个应用于信号数值 1
;小于 -1
或者大于 1
的数值分别按照 -1
和 1
来处理。
如有必要,使用线性插值计算畸变曲线的中间值。
备注:
数组的值可以是 null
: 在这个情况下,不会有畸变被应用到输入的信号上。
语法
js
var audioCtx = new AudioContext();
var distortion = audioCtx.createWaveShaper();
distortion.curve = myCurveDataArray; // myCurveDataArray is a Float32Array
Value
一个 Float32Array
.
示例
参见 BaseAudioContext.createWaveShaper()
以获取示例代码。
规范
Specification |
---|
Web Audio API # dom-waveshapernode-curve |
浏览器兼容性
Report problems with this compatibility data on GitHubdesktop | mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
curve |
Legend
Tip: you can click/tap on a cell for more information.
- Full support
- Full support
The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.