| 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 ActiveScriptWrappable, | 33 ActiveScriptWrappable, |
| 34 Constructor, | |
| 35 ConstructorCallWith=Document, | |
| 36 DependentLifetime, | 34 DependentLifetime, |
| 37 GarbageCollected, | 35 GarbageCollected, |
| 38 ImplementedAs=AbstractAudioContext, | |
| 39 NoInterfaceObject, | 36 NoInterfaceObject, |
| 40 RaisesException=Constructor, | 37 ] interface BaseAudioContext : EventTarget { |
| 41 ] interface AudioContext : EventTarget { | |
| 42 // All rendered audio ultimately connects to destination, which represents t
he audio hardware. | 38 // All rendered audio ultimately connects to destination, which represents t
he audio hardware. |
| 43 readonly attribute AudioDestinationNode destination; | 39 readonly attribute AudioDestinationNode destination; |
| 44 | 40 |
| 45 // All scheduled times are relative to this time in seconds. | 41 // All scheduled times are relative to this time in seconds. |
| 46 readonly attribute double currentTime; | 42 readonly attribute double currentTime; |
| 47 | 43 |
| 48 // All AudioNodes in the context run at this sample-rate (sample-frames per
second). | 44 // All AudioNodes in the context run at this sample-rate (sample-frames per
second). |
| 49 readonly attribute float sampleRate; | 45 readonly attribute float sampleRate; |
| 50 | 46 |
| 51 // All panning is relative to this listener. | 47 // All panning is relative to this listener. |
| 52 readonly attribute AudioListener listener; | 48 readonly attribute AudioListener listener; |
| 53 | 49 |
| 54 // Current state of the AudioContext | 50 // Current state of the AudioContext |
| 55 readonly attribute AudioContextState state; | 51 readonly attribute AudioContextState state; |
| 56 | 52 |
| 57 [RaisesException] AudioBuffer createBuffer(unsigned long numberOfChannels, u
nsigned long numberOfFrames, float sampleRate); | 53 [RaisesException] AudioBuffer createBuffer(unsigned long numberOfChannels, u
nsigned long numberOfFrames, float sampleRate); |
| 58 | 54 |
| 59 // Asynchronous audio file data decoding. | 55 // Asynchronous audio file data decoding. |
| 60 [RaisesException, MeasureAs=AudioContextDecodeAudioData, CallWith=ScriptStat
e] Promise<AudioBuffer> decodeAudioData(ArrayBuffer audioData, optional AudioBuf
ferCallback successCallback, optional AudioBufferCallback errorCallback); | 56 [RaisesException, MeasureAs=AudioContextDecodeAudioData, CallWith=ScriptStat
e] Promise<AudioBuffer> decodeAudioData(ArrayBuffer audioData, optional AudioBuf
ferCallback successCallback, optional AudioBufferCallback errorCallback); |
| 61 | 57 |
| 62 // Sources | 58 // Sources |
| 63 [RaisesException, MeasureAs=AudioContextCreateBufferSource] AudioBufferSourc
eNode createBufferSource(); | 59 [RaisesException, MeasureAs=AudioContextCreateBufferSource] AudioBufferSourc
eNode createBufferSource(); |
| 64 | 60 |
| 65 [RaisesException, MeasureAs=AudioContextCreateMediaElementSource] MediaEleme
ntAudioSourceNode createMediaElementSource(HTMLMediaElement mediaElement); | |
| 66 | |
| 67 [RaisesException, MeasureAs=AudioContextCreateMediaStreamSource] MediaStream
AudioSourceNode createMediaStreamSource(MediaStream mediaStream); | |
| 68 [RaisesException, MeasureAs=AudioContextCreateMediaStreamDestination] MediaS
treamAudioDestinationNode createMediaStreamDestination(); | |
| 69 | |
| 70 // Processing nodes | 61 // Processing nodes |
| 71 [RaisesException, MeasureAs=AudioContextCreateGain] GainNode createGain(); | 62 [RaisesException, MeasureAs=AudioContextCreateGain] GainNode createGain(); |
| 72 [RaisesException, MeasureAs=AudioContextCreateDelay] DelayNode createDelay(o
ptional double maxDelayTime); | 63 [RaisesException, MeasureAs=AudioContextCreateDelay] DelayNode createDelay(o
ptional double maxDelayTime); |
| 73 [RaisesException, MeasureAs=AudioContextCreateBiquadFilter] BiquadFilterNode
createBiquadFilter(); | 64 [RaisesException, MeasureAs=AudioContextCreateBiquadFilter] BiquadFilterNode
createBiquadFilter(); |
| 74 [RaisesException, MeasureAs=AudioContextCreateIIRFilter] IIRFilterNode creat
eIIRFilter(sequence<double> feedForward, sequence<double> feedBack); | 65 [RaisesException, MeasureAs=AudioContextCreateIIRFilter] IIRFilterNode creat
eIIRFilter(sequence<double> feedForward, sequence<double> feedBack); |
| 75 [RaisesException, MeasureAs=AudioContextCreateWaveShaper] WaveShaperNode cre
ateWaveShaper(); | 66 [RaisesException, MeasureAs=AudioContextCreateWaveShaper] WaveShaperNode cre
ateWaveShaper(); |
| 76 [RaisesException, MeasureAs=AudioContextCreatePanner] PannerNode createPanne
r(); | 67 [RaisesException, MeasureAs=AudioContextCreatePanner] PannerNode createPanne
r(); |
| 77 [RaisesException, MeasureAs=AudioContextCreateConvolver] ConvolverNode creat
eConvolver(); | 68 [RaisesException, MeasureAs=AudioContextCreateConvolver] ConvolverNode creat
eConvolver(); |
| 78 [RaisesException, MeasureAs=AudioContextCreateDynamicsCompressor] DynamicsCo
mpressorNode createDynamicsCompressor(); | 69 [RaisesException, MeasureAs=AudioContextCreateDynamicsCompressor] DynamicsCo
mpressorNode createDynamicsCompressor(); |
| 79 [RaisesException, MeasureAs=AudioContextCreateAnalyser] AnalyserNode createA
nalyser(); | 70 [RaisesException, MeasureAs=AudioContextCreateAnalyser] AnalyserNode createA
nalyser(); |
| 80 [RaisesException, MeasureAs=AudioContextCreateScriptProcessor] ScriptProcess
orNode createScriptProcessor(optional unsigned long bufferSize, optional unsigne
d long numberOfInputChannels, optional unsigned long numberOfOutputChannels); | 71 [RaisesException, MeasureAs=AudioContextCreateScriptProcessor] ScriptProcess
orNode createScriptProcessor(optional unsigned long bufferSize, optional unsigne
d long numberOfInputChannels, optional unsigned long numberOfOutputChannels); |
| 81 [RaisesException, MeasureAs=AudioContextCreateStereoPanner] StereoPannerNode
createStereoPanner(); | 72 [RaisesException, MeasureAs=AudioContextCreateStereoPanner] StereoPannerNode
createStereoPanner(); |
| 82 [RaisesException, MeasureAs=AudioContextCreateOscillator] OscillatorNode cre
ateOscillator(); | 73 [RaisesException, MeasureAs=AudioContextCreateOscillator] OscillatorNode cre
ateOscillator(); |
| 83 [RaisesException, MeasureAs=AudioContextCreatePeriodicWave] PeriodicWave cre
atePeriodicWave(Float32Array real, Float32Array imag, optional Dictionary option
s); | 74 [RaisesException, MeasureAs=AudioContextCreatePeriodicWave] PeriodicWave cre
atePeriodicWave(Float32Array real, Float32Array imag, optional Dictionary option
s); |
| 84 | 75 |
| 85 // Channel splitting and merging | 76 // Channel splitting and merging |
| 86 [RaisesException, MeasureAs=AudioContextCreateChannelSplitter] ChannelSplitt
erNode createChannelSplitter(optional unsigned long numberOfOutputs); | 77 [RaisesException, MeasureAs=AudioContextCreateChannelSplitter] ChannelSplitt
erNode createChannelSplitter(optional unsigned long numberOfOutputs); |
| 87 [RaisesException, MeasureAs=AudioContextCreateChannelMerger] ChannelMergerNo
de createChannelMerger(optional unsigned long numberOfInputs); | 78 [RaisesException, MeasureAs=AudioContextCreateChannelMerger] ChannelMergerNo
de createChannelMerger(optional unsigned long numberOfInputs); |
| 88 | 79 |
| 89 // Close | 80 // Close |
| 90 [MeasureAs=AudioContextClose, CallWith=ScriptState, ImplementedAs=closeConte
xt] Promise<void> close(); | 81 [MeasureAs=AudioContextClose, CallWith=ScriptState, ImplementedAs=closeConte
xt] Promise<void> close(); |
| 91 | 82 |
| 92 // Pause/resume | 83 // Pause/resume |
| 93 [MeasureAs=AudioContextSuspend, CallWith=ScriptState, ImplementedAs=suspendC
ontext] Promise<void> suspend(); | 84 [MeasureAs=AudioContextSuspend, CallWith=ScriptState, ImplementedAs=suspendC
ontext] Promise<void> suspend(); |
| 94 [MeasureAs=AudioContextResume, CallWith=ScriptState, ImplementedAs=resumeCon
text] Promise<void> resume(); | 85 [MeasureAs=AudioContextResume, CallWith=ScriptState, ImplementedAs=resumeCon
text] Promise<void> resume(); |
| 95 | 86 |
| 96 attribute EventHandler onstatechange; | 87 attribute EventHandler onstatechange; |
| 97 }; | 88 }; |
| OLD | NEW |