Thu, 22 Jan 2015 13:21:57 +0100
Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6
michael@0 | 1 | /* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ |
michael@0 | 2 | /* This Source Code Form is subject to the terms of the Mozilla Public |
michael@0 | 3 | * License, v. 2.0. If a copy of the MPL was not distributed with this file, |
michael@0 | 4 | * You can obtain one at http://mozilla.org/MPL/2.0/. |
michael@0 | 5 | * |
michael@0 | 6 | * The origin of this IDL file is |
michael@0 | 7 | * https://dvcs.w3.org/hg/audio/raw-file/tip/webaudio/specification.html |
michael@0 | 8 | * |
michael@0 | 9 | * Copyright © 2012 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C |
michael@0 | 10 | * liability, trademark and document use rules apply. |
michael@0 | 11 | */ |
michael@0 | 12 | |
michael@0 | 13 | callback DecodeSuccessCallback = void (AudioBuffer decodedData); |
michael@0 | 14 | callback DecodeErrorCallback = void (); |
michael@0 | 15 | |
michael@0 | 16 | [Constructor, |
michael@0 | 17 | Constructor(AudioChannel audioChannelType)] |
michael@0 | 18 | interface AudioContext : EventTarget { |
michael@0 | 19 | |
michael@0 | 20 | readonly attribute AudioDestinationNode destination; |
michael@0 | 21 | readonly attribute float sampleRate; |
michael@0 | 22 | readonly attribute double currentTime; |
michael@0 | 23 | readonly attribute AudioListener listener; |
michael@0 | 24 | |
michael@0 | 25 | [NewObject, Throws] |
michael@0 | 26 | AudioBuffer createBuffer(unsigned long numberOfChannels, unsigned long length, float sampleRate); |
michael@0 | 27 | |
michael@0 | 28 | void decodeAudioData(ArrayBuffer audioData, |
michael@0 | 29 | DecodeSuccessCallback successCallback, |
michael@0 | 30 | optional DecodeErrorCallback errorCallback); |
michael@0 | 31 | |
michael@0 | 32 | // AudioNode creation |
michael@0 | 33 | [NewObject] |
michael@0 | 34 | AudioBufferSourceNode createBufferSource(); |
michael@0 | 35 | |
michael@0 | 36 | [NewObject, Throws] |
michael@0 | 37 | MediaStreamAudioDestinationNode createMediaStreamDestination(); |
michael@0 | 38 | |
michael@0 | 39 | [NewObject, Throws] |
michael@0 | 40 | ScriptProcessorNode createScriptProcessor(optional unsigned long bufferSize = 0, |
michael@0 | 41 | optional unsigned long numberOfInputChannels = 2, |
michael@0 | 42 | optional unsigned long numberOfOutputChannels = 2); |
michael@0 | 43 | |
michael@0 | 44 | [NewObject] |
michael@0 | 45 | AnalyserNode createAnalyser(); |
michael@0 | 46 | [NewObject, Throws] |
michael@0 | 47 | MediaElementAudioSourceNode createMediaElementSource(HTMLMediaElement mediaElement); |
michael@0 | 48 | [NewObject, Throws] |
michael@0 | 49 | MediaStreamAudioSourceNode createMediaStreamSource(MediaStream mediaStream); |
michael@0 | 50 | [NewObject] |
michael@0 | 51 | GainNode createGain(); |
michael@0 | 52 | [NewObject, Throws] |
michael@0 | 53 | DelayNode createDelay(optional double maxDelayTime = 1); |
michael@0 | 54 | [NewObject] |
michael@0 | 55 | BiquadFilterNode createBiquadFilter(); |
michael@0 | 56 | [NewObject] |
michael@0 | 57 | WaveShaperNode createWaveShaper(); |
michael@0 | 58 | [NewObject] |
michael@0 | 59 | PannerNode createPanner(); |
michael@0 | 60 | [NewObject] |
michael@0 | 61 | ConvolverNode createConvolver(); |
michael@0 | 62 | |
michael@0 | 63 | [NewObject, Throws] |
michael@0 | 64 | ChannelSplitterNode createChannelSplitter(optional unsigned long numberOfOutputs = 6); |
michael@0 | 65 | [NewObject, Throws] |
michael@0 | 66 | ChannelMergerNode createChannelMerger(optional unsigned long numberOfInputs = 6); |
michael@0 | 67 | |
michael@0 | 68 | [NewObject] |
michael@0 | 69 | DynamicsCompressorNode createDynamicsCompressor(); |
michael@0 | 70 | |
michael@0 | 71 | [NewObject] |
michael@0 | 72 | OscillatorNode createOscillator(); |
michael@0 | 73 | [NewObject, Throws] |
michael@0 | 74 | PeriodicWave createPeriodicWave(Float32Array real, Float32Array imag); |
michael@0 | 75 | |
michael@0 | 76 | }; |
michael@0 | 77 | |
michael@0 | 78 | // Mozilla extensions |
michael@0 | 79 | partial interface AudioContext { |
michael@0 | 80 | // Read AudioChannel.webidl for more information about this attribute. |
michael@0 | 81 | [Pref="media.useAudioChannelService", SetterThrows] |
michael@0 | 82 | attribute AudioChannel mozAudioChannelType; |
michael@0 | 83 | }; |