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-05-03 13:42:28 -07:00
|
|
|
[Creator, Throws]
|
|
|
|
AudioBuffer? createBuffer(ArrayBuffer buffer, boolean mixToMono);
|
2012-09-21 15:42:14 -07:00
|
|
|
|
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-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();
|
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();
|
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();
|
|
|
|
|
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 {
|
|
|
|
// Same as createGain()
|
|
|
|
[Creator]
|
|
|
|
GainNode createGainNode();
|
|
|
|
|
|
|
|
// Same as createDelay()
|
|
|
|
[Creator, Throws]
|
|
|
|
DelayNode createDelayNode(optional double maxDelayTime = 1);
|
|
|
|
|
|
|
|
// Same as createScriptProcessor()
|
2013-04-13 18:37:04 -07:00
|
|
|
[Creator, Throws]
|
|
|
|
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
|
|
|
};
|
|
|
|
|
|
|
|
|