Spaces:
Running
Running
File size: 661 Bytes
6bcb42f |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
class HighPassEffect {
constructor (audioContext, startSeconds, endSeconds) {
this.audioContext = audioContext;
this.input = this.audioContext.createGain();
this.output = this.audioContext.createGain();
this.effect = this.audioContext.createBiquadFilter();
this.effect.type = "highpass";
this.effect.frequency.value = 0;
this.effect.Q.value = 0.7;
this.effect.frequency.setValueAtTime(800, startSeconds);
this.effect.frequency.setValueAtTime(0, endSeconds);
this.input.connect(this.effect);
this.effect.connect(this.output);
}
}
export default HighPassEffect;
|