2012-09-01 00:59:37 +04:00
|
|
|
/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* 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://dvcs.w3.org/hg/audio/raw-file/tip/webaudio/specification.html
|
|
|
|
*
|
|
|
|
* Copyright © 2012 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C
|
|
|
|
* liability, trademark and document use rules apply.
|
|
|
|
*/
|
|
|
|
|
2013-02-02 02:13:23 +04:00
|
|
|
callback DecodeSuccessCallback = void (AudioBuffer decodedData);
|
|
|
|
callback DecodeErrorCallback = void ();
|
|
|
|
|
2012-09-08 02:13:26 +04:00
|
|
|
[Constructor, PrefControlled]
|
2013-04-25 08:28:39 +04:00
|
|
|
interface AudioContext : EventTarget {
|
2012-09-19 03:07:33 +04:00
|
|
|
|
|
|
|
readonly attribute AudioDestinationNode destination;
|
2012-11-30 07:31:39 +04:00
|
|
|
readonly attribute float sampleRate;
|
2013-03-15 05:01:02 +04:00
|
|
|
readonly attribute double currentTime;
|
2012-11-06 04:26:03 +04:00
|
|
|
readonly attribute AudioListener listener;
|
2012-09-19 03:07:33 +04:00
|
|
|
|
2012-09-22 02:42:14 +04:00
|
|
|
[Creator, Throws]
|
|
|
|
AudioBuffer createBuffer(unsigned long numberOfChannels, unsigned long length, float sampleRate);
|
|
|
|
|
2013-02-02 02:13:23 +04:00
|
|
|
void decodeAudioData(ArrayBuffer audioData,
|
|
|
|
DecodeSuccessCallback successCallback,
|
|
|
|
optional DecodeErrorCallback errorCallback);
|
|
|
|
|
2012-09-19 03:07:33 +04:00
|
|
|
// AudioNode creation
|
2012-09-25 07:31:58 +04:00
|
|
|
[Creator]
|
2012-09-19 03:07:33 +04:00
|
|
|
AudioBufferSourceNode createBufferSource();
|
|
|
|
|
2013-07-18 13:57:38 +04:00
|
|
|
[Creator, Throws]
|
2013-05-21 23:17:47 +04:00
|
|
|
MediaStreamAudioDestinationNode createMediaStreamDestination();
|
|
|
|
|
2013-04-14 05:37:04 +04:00
|
|
|
[Creator, Throws]
|
|
|
|
ScriptProcessorNode createScriptProcessor(optional unsigned long bufferSize = 0,
|
|
|
|
optional unsigned long numberOfInputChannels = 2,
|
|
|
|
optional unsigned long numberOfOutputChannels = 2);
|
|
|
|
|
2013-04-01 07:41:14 +04:00
|
|
|
[Creator]
|
|
|
|
AnalyserNode createAnalyser();
|
2013-07-24 15:29:39 +04:00
|
|
|
[Creator, Throws]
|
2013-07-25 07:01:49 +04:00
|
|
|
MediaElementAudioSourceNode createMediaElementSource(HTMLMediaElement mediaElement);
|
|
|
|
[Creator, Throws]
|
2013-07-24 15:29:39 +04:00
|
|
|
MediaStreamAudioSourceNode createMediaStreamSource(MediaStream mediaStream);
|
2012-10-31 23:09:32 +04:00
|
|
|
[Creator]
|
|
|
|
GainNode createGain();
|
2012-11-08 22:17:22 +04:00
|
|
|
[Creator, Throws]
|
2012-11-20 00:52:29 +04:00
|
|
|
DelayNode createDelay(optional double maxDelayTime = 1);
|
2012-11-06 06:14:13 +04:00
|
|
|
[Creator]
|
2012-11-08 05:59:14 +04:00
|
|
|
BiquadFilterNode createBiquadFilter();
|
|
|
|
[Creator]
|
2013-05-14 08:12:30 +04:00
|
|
|
WaveShaperNode createWaveShaper();
|
|
|
|
[Creator]
|
2012-11-06 06:14:13 +04:00
|
|
|
PannerNode createPanner();
|
2013-06-11 00:07:55 +04:00
|
|
|
[Creator]
|
|
|
|
ConvolverNode createConvolver();
|
2012-10-31 23:09:32 +04:00
|
|
|
|
2013-05-05 19:49:13 +04:00
|
|
|
[Creator, Throws]
|
|
|
|
ChannelSplitterNode createChannelSplitter(optional unsigned long numberOfOutputs = 6);
|
2013-05-05 19:49:37 +04:00
|
|
|
[Creator, Throws]
|
|
|
|
ChannelMergerNode createChannelMerger(optional unsigned long numberOfInputs = 6);
|
2013-05-05 19:49:13 +04:00
|
|
|
|
2012-11-07 05:01:11 +04:00
|
|
|
[Creator]
|
|
|
|
DynamicsCompressorNode createDynamicsCompressor();
|
|
|
|
|
2013-08-19 22:53:00 +04:00
|
|
|
[Creator]
|
|
|
|
OscillatorNode createOscillator();
|
2013-05-28 15:19:07 +04:00
|
|
|
[Creator, Throws]
|
2013-06-20 02:24:26 +04:00
|
|
|
PeriodicWave createPeriodicWave(Float32Array real, Float32Array imag);
|
2013-05-28 15:19:07 +04:00
|
|
|
|
2012-09-01 00:59:37 +04:00
|
|
|
};
|
|
|
|
|
2013-04-12 06:08:05 +04:00
|
|
|
/*
|
|
|
|
* The origin of this IDL file is
|
|
|
|
* https://dvcs.w3.org/hg/audio/raw-file/tip/webaudio/specification.html#AlternateNames
|
|
|
|
*/
|
|
|
|
[PrefControlled]
|
|
|
|
partial interface AudioContext {
|
2013-07-04 17:25:12 +04:00
|
|
|
[Creator, Throws]
|
|
|
|
AudioBuffer? createBuffer(ArrayBuffer buffer, boolean mixToMono);
|
|
|
|
|
2013-04-12 06:08:05 +04:00
|
|
|
// Same as createGain()
|
2013-06-24 03:22:10 +04:00
|
|
|
[Creator,Pref="media.webaudio.legacy.AudioContext"]
|
2013-04-12 06:08:05 +04:00
|
|
|
GainNode createGainNode();
|
2013-07-04 17:25:12 +04:00
|
|
|
|
2013-04-12 06:08:05 +04:00
|
|
|
// Same as createDelay()
|
2013-06-24 03:22:10 +04:00
|
|
|
[Creator, Throws, Pref="media.webaudio.legacy.AudioContext"]
|
2013-04-12 06:08:05 +04:00
|
|
|
DelayNode createDelayNode(optional double maxDelayTime = 1);
|
|
|
|
|
|
|
|
// Same as createScriptProcessor()
|
2013-06-24 03:22:10 +04:00
|
|
|
[Creator, Throws, Pref="media.webaudio.legacy.AudioContext"]
|
2013-04-14 05:37:04 +04:00
|
|
|
ScriptProcessorNode createJavaScriptNode(optional unsigned long bufferSize = 0,
|
|
|
|
optional unsigned long numberOfInputChannels = 2,
|
|
|
|
optional unsigned long numberOfOutputChannels = 2);
|
2013-04-12 06:08:05 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
|