| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2010, Google Inc. All rights reserved. | 2 * Copyright (C) 2010, Google Inc. All rights reserved. |
| 3 * Copyright (C) 2011 Apple Inc. All rights reserved. | 3 * Copyright (C) 2011 Apple Inc. All rights reserved. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
| 7 * are met: | 7 * are met: |
| 8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 */ | 24 */ |
| 25 | 25 |
| 26 enum AudioContextState { | 26 enum AudioContextState { |
| 27 "suspended", | 27 "suspended", |
| 28 "running", | 28 "running", |
| 29 "closed" | 29 "closed" |
| 30 }; | 30 }; |
| 31 | 31 |
| 32 [ | 32 [ |
| 33 GarbageCollected, | 33 GarbageCollected, |
| 34 ActiveDOMObject, | 34 DependentLifetime, |
| 35 Conditional=WEB_AUDIO, | |
| 36 Constructor, | 35 Constructor, |
| 37 ConstructorCallWith=Document, | 36 ConstructorCallWith=Document, |
| 37 ImplementedAs=AbstractAudioContext, |
| 38 NoInterfaceObject, | 38 NoInterfaceObject, |
| 39 RaisesException=Constructor, | 39 RaisesException=Constructor, |
| 40 ] interface AudioContext : EventTarget { | 40 ] interface AudioContext : EventTarget { |
| 41 // All rendered audio ultimately connects to destination, which represents t
he audio hardware. | 41 // All rendered audio ultimately connects to destination, which represents t
he audio hardware. |
| 42 readonly attribute AudioDestinationNode destination; | 42 readonly attribute AudioDestinationNode destination; |
| 43 | 43 |
| 44 // All scheduled times are relative to this time in seconds. | 44 // All scheduled times are relative to this time in seconds. |
| 45 readonly attribute double currentTime; | 45 readonly attribute double currentTime; |
| 46 | 46 |
| 47 // All AudioNodes in the context run at this sample-rate (sample-frames per
second). | 47 // All AudioNodes in the context run at this sample-rate (sample-frames per
second). |
| 48 readonly attribute float sampleRate; | 48 readonly attribute float sampleRate; |
| 49 | 49 |
| 50 // All panning is relative to this listener. | 50 // All panning is relative to this listener. |
| 51 readonly attribute AudioListener listener; | 51 readonly attribute AudioListener listener; |
| 52 | 52 |
| 53 // Current state of the AudioContext | 53 // Current state of the AudioContext |
| 54 readonly attribute AudioContextState state; | 54 readonly attribute AudioContextState state; |
| 55 | 55 |
| 56 [RaisesException] AudioBuffer createBuffer(unsigned long numberOfChannels, u
nsigned long numberOfFrames, float sampleRate); | 56 [RaisesException] AudioBuffer createBuffer(unsigned long numberOfChannels, u
nsigned long numberOfFrames, float sampleRate); |
| 57 | 57 |
| 58 // Asynchronous audio file data decoding. | 58 // Asynchronous audio file data decoding. |
| 59 [RaisesException, MeasureAs=AudioContextDecodeAudioData] void decodeAudioDat
a(ArrayBuffer audioData, AudioBufferCallback successCallback, optional AudioBuff
erCallback errorCallback); | 59 [RaisesException, MeasureAs=AudioContextDecodeAudioData, CallWith=ScriptStat
e] Promise<AudioBuffer> decodeAudioData(ArrayBuffer audioData, optional AudioBuf
ferCallback successCallback, optional AudioBufferCallback errorCallback); |
| 60 | 60 |
| 61 // Sources | 61 // Sources |
| 62 [RaisesException, MeasureAs=AudioContextCreateBufferSource] AudioBufferSourc
eNode createBufferSource(); | 62 [RaisesException, MeasureAs=AudioContextCreateBufferSource] AudioBufferSourc
eNode createBufferSource(); |
| 63 | 63 |
| 64 [RaisesException, MeasureAs=AudioContextCreateMediaElementSource] MediaEleme
ntAudioSourceNode createMediaElementSource(HTMLMediaElement mediaElement); | 64 [RaisesException, MeasureAs=AudioContextCreateMediaElementSource] MediaEleme
ntAudioSourceNode createMediaElementSource(HTMLMediaElement mediaElement); |
| 65 | 65 |
| 66 [RaisesException, MeasureAs=AudioContextCreateMediaStreamSource, RaisesExcep
tion] MediaStreamAudioSourceNode createMediaStreamSource(MediaStream mediaStream
); | 66 [RaisesException, MeasureAs=AudioContextCreateMediaStreamSource] MediaStream
AudioSourceNode createMediaStreamSource(MediaStream mediaStream); |
| 67 [RaisesException, MeasureAs=AudioContextCreateMediaStreamDestination] MediaS
treamAudioDestinationNode createMediaStreamDestination(); | 67 [RaisesException, MeasureAs=AudioContextCreateMediaStreamDestination] MediaS
treamAudioDestinationNode createMediaStreamDestination(); |
| 68 | 68 |
| 69 // Processing nodes | 69 // Processing nodes |
| 70 [RaisesException, MeasureAs=AudioContextCreateGain] GainNode createGain(); | 70 [RaisesException, MeasureAs=AudioContextCreateGain] GainNode createGain(); |
| 71 [RaisesException, MeasureAs=AudioContextCreateDelay] DelayNode createDelay(o
ptional double maxDelayTime); | 71 [RaisesException, MeasureAs=AudioContextCreateDelay] DelayNode createDelay(o
ptional double maxDelayTime); |
| 72 [RaisesException, MeasureAs=AudioContextCreateBiquadFilter] BiquadFilterNode
createBiquadFilter(); | 72 [RaisesException, MeasureAs=AudioContextCreateBiquadFilter] BiquadFilterNode
createBiquadFilter(); |
| 73 [RaisesException, MeasureAs=AudioContextCreateIIRFilter] IIRFilterNode creat
eIIRFilter(sequence<double> feedForward, sequence<double> feedBack); |
| 73 [RaisesException, MeasureAs=AudioContextCreateWaveShaper] WaveShaperNode cre
ateWaveShaper(); | 74 [RaisesException, MeasureAs=AudioContextCreateWaveShaper] WaveShaperNode cre
ateWaveShaper(); |
| 74 [RaisesException, MeasureAs=AudioContextCreatePanner] PannerNode createPanne
r(); | 75 [RaisesException, MeasureAs=AudioContextCreatePanner] PannerNode createPanne
r(); |
| 75 [RaisesException, MeasureAs=AudioContextCreateConvolver] ConvolverNode creat
eConvolver(); | 76 [RaisesException, MeasureAs=AudioContextCreateConvolver] ConvolverNode creat
eConvolver(); |
| 76 [RaisesException, MeasureAs=AudioContextCreateDynamicsCompressor] DynamicsCo
mpressorNode createDynamicsCompressor(); | 77 [RaisesException, MeasureAs=AudioContextCreateDynamicsCompressor] DynamicsCo
mpressorNode createDynamicsCompressor(); |
| 77 [RaisesException, MeasureAs=AudioContextCreateAnalyser] AnalyserNode createA
nalyser(); | 78 [RaisesException, MeasureAs=AudioContextCreateAnalyser] AnalyserNode createA
nalyser(); |
| 78 [RaisesException, MeasureAs=AudioContextCreateScriptProcessor, RaisesExcepti
on] ScriptProcessorNode createScriptProcessor(optional unsigned long bufferSize,
optional unsigned long numberOfInputChannels, optional unsigned long numberOfOu
tputChannels); | 79 [RaisesException, MeasureAs=AudioContextCreateScriptProcessor] ScriptProcess
orNode createScriptProcessor(optional unsigned long bufferSize, optional unsigne
d long numberOfInputChannels, optional unsigned long numberOfOutputChannels); |
| 79 [RaisesException, MeasureAs=AudioContextCreateStereoPanner] StereoPannerNode
createStereoPanner(); | 80 [RaisesException, MeasureAs=AudioContextCreateStereoPanner] StereoPannerNode
createStereoPanner(); |
| 80 [RaisesException, MeasureAs=AudioContextCreateOscillator] OscillatorNode cre
ateOscillator(); | 81 [RaisesException, MeasureAs=AudioContextCreateOscillator] OscillatorNode cre
ateOscillator(); |
| 81 [RaisesException, MeasureAs=AudioContextCreatePeriodicWave, RaisesException]
PeriodicWave createPeriodicWave(Float32Array real, Float32Array imag); | 82 [RaisesException, MeasureAs=AudioContextCreatePeriodicWave] PeriodicWave cre
atePeriodicWave(Float32Array real, Float32Array imag, optional Dictionary option
s); |
| 82 | 83 |
| 83 // Channel splitting and merging | 84 // Channel splitting and merging |
| 84 [RaisesException, MeasureAs=AudioContextCreateChannelSplitter] ChannelSplitt
erNode createChannelSplitter(optional unsigned long numberOfOutputs); | 85 [RaisesException, MeasureAs=AudioContextCreateChannelSplitter] ChannelSplitt
erNode createChannelSplitter(optional unsigned long numberOfOutputs); |
| 85 [RaisesException, MeasureAs=AudioContextCreateChannelMerger] ChannelMergerNo
de createChannelMerger(optional unsigned long numberOfInputs); | 86 [RaisesException, MeasureAs=AudioContextCreateChannelMerger] ChannelMergerNo
de createChannelMerger(optional unsigned long numberOfInputs); |
| 86 | 87 |
| 87 // Close | 88 // Close |
| 88 [MeasureAs=AudioContextClose, CallWith=ScriptState, ImplementedAs=closeConte
xt] Promise<void> close(); | 89 [MeasureAs=AudioContextClose, CallWith=ScriptState, ImplementedAs=closeConte
xt] Promise<void> close(); |
| 89 | 90 |
| 90 // Pause/resume | 91 // Pause/resume |
| 91 [MeasureAs=AudioContextSuspend, CallWith=ScriptState, ImplementedAs=suspendC
ontext] Promise<void> suspend(); | 92 [MeasureAs=AudioContextSuspend, CallWith=ScriptState, ImplementedAs=suspendC
ontext] Promise<void> suspend(); |
| 92 [MeasureAs=AudioContextResume, CallWith=ScriptState, ImplementedAs=resumeCon
text] Promise<void> resume(); | 93 [MeasureAs=AudioContextResume, CallWith=ScriptState, ImplementedAs=resumeCon
text] Promise<void> resume(); |
| 93 | 94 |
| 94 attribute EventHandler onstatechange; | 95 attribute EventHandler onstatechange; |
| 95 }; | 96 }; |
| OLD | NEW |