make vowel work with node

This commit is contained in:
Felix Roos 2022-09-15 20:11:10 +02:00
parent 4406dd88d1
commit 149b2ab9f9

View file

@ -6,7 +6,7 @@ export var vowelFormant = {
o: { freqs: [430, 820, 2700, 3000, 3300], gains: [1, 0.3162, 0.0501, 0.0794, 0.01995], qs: [40, 80, 100, 120, 120] }, o: { freqs: [430, 820, 2700, 3000, 3300], gains: [1, 0.3162, 0.0501, 0.0794, 0.01995], qs: [40, 80, 100, 120, 120] },
u: { freqs: [370, 630, 2750, 3000, 3400], gains: [1, 0.1, 0.0708, 0.0316, 0.01995], qs: [40, 60, 100, 120, 120] }, u: { freqs: [370, 630, 2750, 3000, 3400], gains: [1, 0.1, 0.0708, 0.0316, 0.01995], qs: [40, 60, 100, 120, 120] },
}; };
if (typeof GainNode !== 'undefined') {
class VowelNode extends GainNode { class VowelNode extends GainNode {
constructor(ac, letter) { constructor(ac, letter) {
super(ac); super(ac);
@ -35,3 +35,4 @@ class VowelNode extends GainNode {
AudioContext.prototype.createVowelFilter = function (letter) { AudioContext.prototype.createVowelFilter = function (letter) {
return new VowelNode(this, letter); return new VowelNode(this, letter);
}; };
}