UNPKG

react-native-audio-api

Version:

react-native-audio-api provides system for controlling audio in React Native environment compatible with Web Audio API specification

32 lines (31 loc) 853 B
"use strict"; import { InvalidStateError } from "../errors/index.js"; import AudioNode from "./AudioNode.web.js"; export default class WaveShaperNode extends AudioNode { isCurveSet = false; get curve() { if (!this.isCurveSet) { return null; } return this.node.curve; } get oversample() { return this.node.oversample; } set curve(curve) { if (curve !== null) { if (this.isCurveSet) { throw new InvalidStateError('The curve can only be set once and cannot be changed afterwards.'); } if (curve.length < 2) { throw new InvalidStateError('The curve must have at least two values if not null.'); } this.isCurveSet = true; } this.node.curve = curve; } set oversample(value) { this.node.oversample = value; } } //# sourceMappingURL=WaveShaperNode.web.js.map