Document reverb controls

This commit is contained in:
Raphael Forment 2023-10-01 11:52:24 +02:00
parent 0ad0046a76
commit abff279707
3 changed files with 57 additions and 7 deletions

View file

@ -2,7 +2,13 @@ import reverbGen from './reverbGen.mjs';
if (typeof AudioContext !== 'undefined') {
AudioContext.prototype.generateReverb = reverbGen.generateReverb;
AudioContext.prototype.createReverb = function(duration, audioContext) {
AudioContext.prototype.createReverb = function(
duration,
audioContext,
fade,
revlp,
revdim
) {
const convolver = this.createConvolver();
convolver.setDuration = (d) => {
this.generateReverb(
@ -11,9 +17,9 @@ if (typeof AudioContext !== 'undefined') {
sampleRate: 44100,
numChannels: 2,
decayTime: d,
fadeInTime: d,
lpFreqStart: 2000,
lpFreqEnd: 15000,
fadeInTime: fade,
lpFreqStart: revlp,
lpFreqEnd: revdim,
},
(buffer) => {
convolver.buffer = buffer;