making sure that the decibel values are propagated through to the filter

fixes #807
This commit is contained in:
Yotam Mann 2020-12-14 18:43:40 -05:00
parent 87cf66d772
commit 78452c65d2
2 changed files with 4 additions and 2 deletions

View file

@ -47,7 +47,7 @@ export class BiquadFilter extends ToneAudioNode<BiquadFilterOptions> {
/** /**
* The gain of the filter. Its value is in dB units. The gain is only used for lowshelf, highshelf, and peaking filters. * The gain of the filter. Its value is in dB units. The gain is only used for lowshelf, highshelf, and peaking filters.
*/ */
readonly gain: Param<"gain">; readonly gain: Param<"decibels">;
private readonly _filter: BiquadFilterNode; private readonly _filter: BiquadFilterNode;
@ -87,7 +87,8 @@ export class BiquadFilter extends ToneAudioNode<BiquadFilterOptions> {
this.gain = new Param({ this.gain = new Param({
context: this.context, context: this.context,
units: "gain", units: "decibels",
convert: false,
value: options.gain, value: options.gain,
param: this._filter.gain, param: this._filter.gain,
}); });

View file

@ -90,6 +90,7 @@ export class Filter extends ToneAudioNode<FilterOptions> {
this.gain = new Signal({ this.gain = new Signal({
context: this.context, context: this.context,
units: "decibels", units: "decibels",
convert: false,
value: options.gain, value: options.gain,
}); });
this._type = options.type; this._type = options.type;