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