simplify createReverb

This commit is contained in:
Felix Roos 2023-10-04 23:56:00 +02:00
parent 508af7eb72
commit ce842f7561
2 changed files with 3 additions and 3 deletions

View File

@ -2,12 +2,12 @@ import reverbGen from './reverbGen.mjs';
if (typeof AudioContext !== 'undefined') {
AudioContext.prototype.generateReverb = reverbGen.generateReverb;
AudioContext.prototype.createReverb = function (audioContext, duration, fade, revlp, revdim) {
AudioContext.prototype.createReverb = function (duration, fade, revlp, revdim) {
const convolver = this.createConvolver();
convolver.setDuration = (d, fade, revlp, revdim) => {
this.generateReverb(
{
audioContext,
audioContext: this,
sampleRate: 44100,
numChannels: 2,
decayTime: d,

View File

@ -112,7 +112,7 @@ function getReverb(orbit, duration = 2, fade, lp, dim) {
// If no reverb has been created for a given orbit, create one
if (!reverbs[orbit]) {
const ac = getAudioContext();
const reverb = ac.createReverb(getAudioContext(), duration, fade, lp, dim);
const reverb = ac.createReverb(duration, fade, lp, dim);
reverb.connect(getDestination());
reverbs[orbit] = reverb;
}