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-01-22 17:12:21 -08:00
|
|
|
interface AudioContext {
|
2012-09-18 16:07:33 -07:00
|
|
|
|
|
|
|
readonly attribute AudioDestinationNode destination;
|
2012-11-29 19:31:39 -08:00
|
|
|
readonly attribute float sampleRate;
|
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);
|
|
|
|
|
|
|
|
// [Creator, Throws]
|
|
|
|
// AudioBuffer createBuffer(ArrayBuffer buffer, boolean mixToMono);
|
|
|
|
|
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();
|
|
|
|
|
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]
|
2012-11-05 18:14:13 -08:00
|
|
|
PannerNode createPanner();
|
2012-10-31 12:09:32 -07:00
|
|
|
|
2012-11-06 17:01:11 -08:00
|
|
|
[Creator]
|
|
|
|
DynamicsCompressorNode createDynamicsCompressor();
|
|
|
|
|
2012-08-31 13:59:37 -07:00
|
|
|
};
|
|
|
|
|