From c70704d7b7deb5926b0d006f82b35a4299451091 Mon Sep 17 00:00:00 2001 From: andretshurotshka Date: Sat, 9 Mar 2019 08:14:48 +0500 Subject: [PATCH 1/2] Add ConstantSourceNode --- lib/bom.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/lib/bom.js b/lib/bom.js index 0f1eed349fc..b24cb959626 100644 --- a/lib/bom.js +++ b/lib/bom.js @@ -699,6 +699,7 @@ declare class BaseAudioContext { createBiquadFilter(): BiquadFilterNode; createChannelMerger(numberOfInputs?: number): ChannelMergerNode; createChannelSplitter(numberOfInputs?: number): ChannelSplitterNode; + createConstantSource(): ConstantSourceNode; createConvolver(): ConvolverNode; createDelay(maxDelayTime?: number): DelayNode; createDynamicsCompressor(): DynamicsCompressorNode; @@ -904,6 +905,14 @@ declare class BiquadFilterNode extends AudioNode { declare class ChannelMergerNode extends AudioNode {} declare class ChannelSplitterNode extends AudioNode {} + +declare class ConstantSourceNode extends AudioNode { + offset: AudioParam; + onended: (ev: any) => any; + start(when?: number): void; + stop(when?: number): void; +} + declare class ConvolverNode extends AudioNode { buffer: AudioBuffer; normalize: bool; From f9f03cb4d8ef6b298bfe0b4c5e34a543709e8737 Mon Sep 17 00:00:00 2001 From: andretshurotshka Date: Sat, 9 Mar 2019 08:29:33 +0500 Subject: [PATCH 2/2] Add ConstantSourceOptions --- lib/bom.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/bom.js b/lib/bom.js index b24cb959626..ecbc8a22010 100644 --- a/lib/bom.js +++ b/lib/bom.js @@ -906,7 +906,11 @@ declare class BiquadFilterNode extends AudioNode { declare class ChannelMergerNode extends AudioNode {} declare class ChannelSplitterNode extends AudioNode {} +type ConstantSourceOptions = { + offset?: number; +} declare class ConstantSourceNode extends AudioNode { + constructor(context: BaseAudioContext, options?: ConstantSourceOptions): ConstantSourceNode; offset: AudioParam; onended: (ev: any) => any; start(when?: number): void;