2012-08-31 13:59:37 -07: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-01 14:13:23 -08:00
|
|
|
callback DecodeSuccessCallback = void (AudioBuffer decodedData);
|
|
|
|
callback DecodeErrorCallback = void ();
|
|
|
|
|
2012-09-07 15:13:26 -07:00
|
|
|
[Constructor, PrefControlled]
|
2013-04-24 21:28:39 -07:00
|
|
|
interface AudioContext : EventTarget {
|
2012-09-18 16:07:33 -07:00
|
|
|
|
|
|
|
readonly attribute AudioDestinationNode destination;
|
2012-11-29 19:31:39 -08:00
|
|
|
readonly attribute float sampleRate;
|
2013-03-14 18:01:02 -07:00
|
|
|
readonly attribute double currentTime;
|
2012-11-05 16:26:03 -08:00
|
|
|
readonly attribute AudioListener listener;
|
2012-09-18 16:07:33 -07:00
|
|
|
|
2012-09-21 15:42:14 -07:00
|
|
|
[Creator, Throws]
|
|
|
|
AudioBuffer createBuffer(unsigned long numberOfChannels, unsigned long length, float sampleRate);
|
|
|
|
|
2013-02-01 14:13:23 -08:00
|
|
|
void decodeAudioData(ArrayBuffer audioData,
|
|
|
|
DecodeSuccessCallback successCallback,
|
|
|
|
optional DecodeErrorCallback errorCallback);
|
|
|
|
|
2012-09-18 16:07:33 -07:00
|
|
|
// AudioNode creation
|
2012-09-24 20:31:58 -07:00
|
|
|
[Creator]
|
2012-09-18 16:07:33 -07:00
|
|
|
AudioBufferSourceNode createBufferSource();
|
|
|
|
|
2013-07-18 02:57:38 -07:00
|
|
|
[Creator, Throws]
|
2013-05-21 12:17:47 -07:00
|
|
|
MediaStreamAudioDestinationNode createMediaStreamDestination();
|
|
|
|
|
2013-04-13 18:37:04 -07:00
|
|
|
[Creator, Throws]
|
|
|
|
ScriptProcessorNode createScriptProcessor(optional unsigned long bufferSize = 0,
|
|
|
|
optional unsigned long numberOfInputChannels = 2,
|
|
|
|
optional unsigned long numberOfOutputChannels = 2);
|
|
|
|
|
2013-03-31 20:41:14 -07:00
|
|
|
[Creator]
|
|
|
|
AnalyserNode createAnalyser();
|
2013-07-24 04:29:39 -07:00
|
|
|
[Creator, Throws]
|
2013-07-24 20:01:49 -07:00
|
|
|
MediaElementAudioSourceNode createMediaElementSource(HTMLMediaElement mediaElement);
|
|
|
|
[Creator, Throws]
|
2013-07-24 04:29:39 -07:00
|
|
|
MediaStreamAudioSourceNode createMediaStreamSource(MediaStream mediaStream);
|
2012-10-31 12:09:32 -07:00
|
|
|
[Creator]
|
|
|
|
GainNode createGain();
|
2012-11-08 10:17:22 -08:00
|
|
|
[Creator, Throws]
|
2012-11-19 12:52:29 -08:00
|
|
|
DelayNode createDelay(optional double maxDelayTime = 1);
|
2012-11-05 18:14:13 -08:00
|
|
|
[Creator]
|
2012-11-07 17:59:14 -08:00
|
|
|
BiquadFilterNode createBiquadFilter();
|
|
|
|
[Creator]
|
2013-05-13 21:12:30 -07:00
|
|
|
WaveShaperNode createWaveShaper();
|
|
|
|
[Creator]
|
2012-11-05 18:14:13 -08:00
|
|
|
PannerNode createPanner();
|
2013-06-10 13:07:55 -07:00
|
|
|
[Creator]
|
|
|
|
ConvolverNode createConvolver();
|
2012-10-31 12:09:32 -07:00
|
|
|
|
2013-05-05 08:49:13 -07:00
|
|
|
[Creator, Throws]
|
|
|
|
ChannelSplitterNode createChannelSplitter(optional unsigned long numberOfOutputs = 6);
|
2013-05-05 08:49:37 -07:00
|
|
|
[Creator, Throws]
|
|
|
|
ChannelMergerNode createChannelMerger(optional unsigned long numberOfInputs = 6);
|
2013-05-05 08:49:13 -07:00
|
|
|
|
2012-11-06 17:01:11 -08:00
|
|
|
[Creator]
|
|
|
|
DynamicsCompressorNode createDynamicsCompressor();
|
|
|
|
|
2013-08-19 11:53:00 -07:00
|
|
|
[Creator]
|
|
|
|
OscillatorNode createOscillator();
|
2013-05-28 04:19:07 -07:00
|
|
|
[Creator, Throws]
|
2013-06-19 15:24:26 -07:00
|
|
|
PeriodicWave createPeriodicWave(Float32Array real, Float32Array imag);
|
2013-05-28 04:19:07 -07:00
|
|
|
|
2012-08-31 13:59:37 -07:00
|
|
|
};
|
|
|
|
|
2013-04-11 19:08:05 -07: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 06:25:12 -07:00
|
|
|
[Creator, Throws]
|
|
|
|
AudioBuffer? createBuffer(ArrayBuffer buffer, boolean mixToMono);
|
|
|
|
|
2013-04-11 19:08:05 -07:00
|
|
|
// Same as createGain()
|
2013-06-23 16:22:10 -07:00
|
|
|
[Creator,Pref="media.webaudio.legacy.AudioContext"]
|
2013-04-11 19:08:05 -07:00
|
|
|
GainNode createGainNode();
|
2013-07-04 06:25:12 -07:00
|
|
|
|
2013-04-11 19:08:05 -07:00
|
|
|
// Same as createDelay()
|
2013-06-23 16:22:10 -07:00
|
|
|
[Creator, Throws, Pref="media.webaudio.legacy.AudioContext"]
|
2013-04-11 19:08:05 -07:00
|
|
|
DelayNode createDelayNode(optional double maxDelayTime = 1);
|
|
|
|
|
|
|
|
// Same as createScriptProcessor()
|
2013-06-23 16:22:10 -07:00
|
|
|
[Creator, Throws, Pref="media.webaudio.legacy.AudioContext"]
|
2013-04-13 18:37:04 -07:00
|
|
|
ScriptProcessorNode createJavaScriptNode(optional unsigned long bufferSize = 0,
|
|
|
|
optional unsigned long numberOfInputChannels = 2,
|
|
|
|
optional unsigned long numberOfOutputChannels = 2);
|
2013-04-11 19:08:05 -07:00
|
|
|
};
|
|
|
|
|
|
|
|
|