From 35e40c5d8500681f7d05c9aef81ad50f9e043c85 Mon Sep 17 00:00:00 2001 From: Gabriel Garcia Date: Mon, 20 Jul 2015 18:52:58 -0400 Subject: [PATCH] some WebAudio interface missing methods --- webaudioapi/waa.d.ts | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/webaudioapi/waa.d.ts b/webaudioapi/waa.d.ts index 3ccc78b78..80823700a 100644 --- a/webaudioapi/waa.d.ts +++ b/webaudioapi/waa.d.ts @@ -171,3 +171,35 @@ declare enum OscillatorType { triangle, custom } + +interface AudioContextConstructor { + new(): AudioContext; +} + +interface Window { + AudioContext: AudioContextConstructor; +} + +interface AudioContext { + createMediaStreamSource(stream: MediaStream): MediaStreamAudioSourceNode; +} + +interface MediaStreamAudioSourceNode extends AudioNode { + +} + +interface AudioBuffer { + copyFromChannel(destination: Float32Array, channelNumber: number, startInChannel?: number): void; + + copyToChannel(source: Float32Array, channelNumber: number, startInChannel?: number): void; +} + +interface AudioNode { + disconnect(destination: AudioNode): void; +} + +interface AudioContext { + suspend(): Promise; + resume(): Promise; + close(): Promise; +}