aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/webidls/AudioContext.webidl
diff options
context:
space:
mode:
authorFernando Jiménez Moreno <ferjmoreno@gmail.com>2017-11-07 20:57:30 +0100
committerFernando Jiménez Moreno <ferjmoreno@gmail.com>2018-07-30 14:21:36 +0200
commit7ee42e4223dc970aeffc56ecddec2738c8340f8c (patch)
tree1f53a3dc650992ab7b84c9a9e0e748d11ca97a7d /components/script/dom/webidls/AudioContext.webidl
parentde48f25d0b0b5ecaf0499030f8617a3d37b3fde2 (diff)
downloadservo-7ee42e4223dc970aeffc56ecddec2738c8340f8c.tar.gz
servo-7ee42e4223dc970aeffc56ecddec2738c8340f8c.zip
Initial WebAudio API stubs
Diffstat (limited to 'components/script/dom/webidls/AudioContext.webidl')
-rw-r--r--components/script/dom/webidls/AudioContext.webidl40
1 files changed, 40 insertions, 0 deletions
diff --git a/components/script/dom/webidls/AudioContext.webidl b/components/script/dom/webidls/AudioContext.webidl
new file mode 100644
index 00000000000..07de08f7ac0
--- /dev/null
+++ b/components/script/dom/webidls/AudioContext.webidl
@@ -0,0 +1,40 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+/*
+ * The origin of this IDL file is
+ * https://webaudio.github.io/web-audio-api/#dom-audiocontext
+ */
+
+enum AudioContextLatencyCategory {
+ "balanced",
+ "interactive",
+ "playback"
+};
+
+dictionary AudioContextOptions {
+ AudioContextLatencyCategory latencyHint = "interactive";
+ float sampleRate;
+};
+
+dictionary AudioTimestamp {
+ double contextTime;
+ DOMHighResTimeStamp performanceTime;
+};
+
+[Exposed=Window,
+ Constructor(optional AudioContextOptions contextOptions)]
+interface AudioContext : BaseAudioContext {
+ readonly attribute double baseLatency;
+ readonly attribute double outputLatency;
+
+ AudioTimestamp getOutputTimestamp();
+
+ Promise<void> suspend();
+ Promise<void> close();
+
+ // MediaElementAudioSourceNode createMediaElementSource(HTMLMediaElement mediaElement);
+ // MediaStreamAudioSourceNode createMediaStreamSource(MediaStream mediaStream);
+ // MediaStreamTrackAudioSourceNode createMediaStreamTrackSource(MediaStreamTrack mediaStreamTrack);
+ // MediaStreamAudioDestinationNode createMediaStreamDestination();
+};