delayTime is in Time instead of seconds

This commit is contained in:
Yotam Mann 2019-07-25 10:44:32 -04:00
parent 33d0b3e1b3
commit 111ecc1396

View file

@ -4,8 +4,8 @@ import { readOnly } from "../util/Interface";
import { ToneAudioNode, ToneAudioNodeOptions } from "./ToneAudioNode";
export interface DelayOptions extends ToneAudioNodeOptions {
delayTime: number;
maxDelay: number;
delayTime: Time;
maxDelay: Time;
}
/**
@ -47,9 +47,10 @@ export class Delay extends ToneAudioNode<DelayOptions> {
const options = optionsFromArguments(Delay.getDefaults(), arguments, ["delayTime", "maxDelay"]);
this.maxDelay = Math.max(this.toSeconds(options.maxDelay), this.toSeconds(options.delayTime));
const maxDelayInSeconds = this.toSeconds(options.maxDelay);
this.maxDelay = Math.max(maxDelayInSeconds, this.toSeconds(options.delayTime));
this._delayNode = this.input = this.output = this.context.createDelay(options.maxDelay);
this._delayNode = this.input = this.output = this.context.createDelay(maxDelayInSeconds);
this._internalChannels = [this._delayNode];
this.delayTime = new Param({