fixed test complaint

This commit is contained in:
Jade (Rose) Rowland 2023-12-20 00:25:56 -05:00
parent d7fae2620e
commit 34ba81a841

View file

@ -1,7 +1,8 @@
import { getAudioContext } from './superdough.mjs'; import { getAudioContext } from './superdough.mjs';
import { clamp } from './util.mjs'; import { clamp } from './util.mjs';
AudioParam.prototype.setRelease = function (startTime, endTime, endValue, curve = 'linear') { if (AudioParam != null) {
AudioParam.prototype.setRelease = function (startTime, endTime, endValue, curve = 'linear') {
const ctx = getAudioContext(); const ctx = getAudioContext();
const ramp = curve === 'exponential' ? 'exponentialRampToValueAtTime' : 'linearRampToValueAtTime'; const ramp = curve === 'exponential' ? 'exponentialRampToValueAtTime' : 'linearRampToValueAtTime';
const param = this; const param = this;
@ -20,7 +21,8 @@ AudioParam.prototype.setRelease = function (startTime, endTime, endValue, curve
//release //release
param[ramp](endValue, endTime); param[ramp](endValue, endTime);
} }
}; };
}
export function gainNode(value) { export function gainNode(value) {
const node = getAudioContext().createGain(); const node = getAudioContext().createGain();