| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 // See https://webaudio.github.io/web-audio-api/#BaseAudioContext | 5 // See https://webaudio.github.io/web-audio-api/#BaseAudioContext |
| 6 |
| 6 enum AudioContextState { | 7 enum AudioContextState { |
| 7 "suspended", | 8 "suspended", |
| 8 "running", | 9 "running", |
| 9 "closed" | 10 "closed" |
| 10 }; | 11 }; |
| 11 | 12 |
| 13 callback DecodeErrorCallback = void (DOMException error); |
| 14 callback DecodeSuccessCallback = void (AudioBuffer decodedData); |
| 15 |
| 12 [ | 16 [ |
| 13 ActiveScriptWrappable, | 17 ActiveScriptWrappable, |
| 14 DependentLifetime, | 18 DependentLifetime, |
| 15 ] interface BaseAudioContext : EventTarget { | 19 ] interface BaseAudioContext : EventTarget { |
| 16 // All rendered audio ultimately connects to destination, which represents t
he audio hardware. | 20 // All rendered audio ultimately connects to destination, which represents t
he audio hardware. |
| 17 readonly attribute AudioDestinationNode destination; | 21 readonly attribute AudioDestinationNode destination; |
| 18 | 22 |
| 19 // All scheduled times are relative to this time in seconds. | 23 // All scheduled times are relative to this time in seconds. |
| 20 readonly attribute double currentTime; | 24 readonly attribute double currentTime; |
| 21 | 25 |
| 22 // All AudioNodes in the context run at this sample-rate (sample-frames per
second). | 26 // All AudioNodes in the context run at this sample-rate (sample-frames per
second). |
| 23 readonly attribute float sampleRate; | 27 readonly attribute float sampleRate; |
| 24 | 28 |
| 25 // All panning is relative to this listener. | 29 // All panning is relative to this listener. |
| 26 readonly attribute AudioListener listener; | 30 readonly attribute AudioListener listener; |
| 27 | 31 |
| 28 // Current state of the AudioContext | 32 // Current state of the AudioContext |
| 29 readonly attribute AudioContextState state; | 33 readonly attribute AudioContextState state; |
| 30 | 34 |
| 31 [RaisesException] AudioBuffer createBuffer(unsigned long numberOfChannels, u
nsigned long numberOfFrames, float sampleRate); | 35 [RaisesException] AudioBuffer createBuffer(unsigned long numberOfChannels, u
nsigned long numberOfFrames, float sampleRate); |
| 32 | 36 |
| 33 // Asynchronous audio file data decoding. | 37 // Asynchronous audio file data decoding. |
| 34 [RaisesException, MeasureAs=AudioContextDecodeAudioData, CallWith=ScriptStat
e] Promise<AudioBuffer> decodeAudioData(ArrayBuffer audioData, optional AudioBuf
ferCallback successCallback, optional AudioBufferCallback errorCallback); | 38 [RaisesException, MeasureAs=AudioContextDecodeAudioData, CallWith=ScriptStat
e] Promise<AudioBuffer> decodeAudioData(ArrayBuffer audioData, optional DecodeSu
ccessCallback successCallback, optional DecodeErrorCallback errorCallback); |
| 35 | 39 |
| 36 // Sources | 40 // Sources |
| 37 [RaisesException, MeasureAs=AudioContextCreateBufferSource] AudioBufferSourc
eNode createBufferSource(); | 41 [RaisesException, MeasureAs=AudioContextCreateBufferSource] AudioBufferSourc
eNode createBufferSource(); |
| 38 [RaisesException, MeasureAs=AudioContextCreateConstantSource] ConstantSource
Node createConstantSource(); | 42 [RaisesException, MeasureAs=AudioContextCreateConstantSource] ConstantSource
Node createConstantSource(); |
| 39 | 43 |
| 40 // Processing nodes | 44 // Processing nodes |
| 41 [RaisesException, MeasureAs=AudioContextCreateGain] GainNode createGain(); | 45 [RaisesException, MeasureAs=AudioContextCreateGain] GainNode createGain(); |
| 42 [RaisesException, MeasureAs=AudioContextCreateDelay] DelayNode createDelay(o
ptional double maxDelayTime); | 46 [RaisesException, MeasureAs=AudioContextCreateDelay] DelayNode createDelay(o
ptional double maxDelayTime); |
| 43 [RaisesException, MeasureAs=AudioContextCreateBiquadFilter] BiquadFilterNode
createBiquadFilter(); | 47 [RaisesException, MeasureAs=AudioContextCreateBiquadFilter] BiquadFilterNode
createBiquadFilter(); |
| 44 [RaisesException, MeasureAs=AudioContextCreateIIRFilter] IIRFilterNode creat
eIIRFilter(sequence<double> feedForward, sequence<double> feedBack); | 48 [RaisesException, MeasureAs=AudioContextCreateIIRFilter] IIRFilterNode creat
eIIRFilter(sequence<double> feedForward, sequence<double> feedBack); |
| (...skipping 15 matching lines...) Expand all Loading... |
| 60 [MeasureAs=AudioContextResume, CallWith=ScriptState, ImplementedAs=resumeCon
text] Promise<void> resume(); | 64 [MeasureAs=AudioContextResume, CallWith=ScriptState, ImplementedAs=resumeCon
text] Promise<void> resume(); |
| 61 | 65 |
| 62 // TODO(rtoy): These really belong to the AudioContext, but we need them | 66 // TODO(rtoy): These really belong to the AudioContext, but we need them |
| 63 // here so we can use an offline audio context to test these. | 67 // here so we can use an offline audio context to test these. |
| 64 [RaisesException, MeasureAs=AudioContextCreateMediaElementSource] MediaEleme
ntAudioSourceNode createMediaElementSource(HTMLMediaElement mediaElement); | 68 [RaisesException, MeasureAs=AudioContextCreateMediaElementSource] MediaEleme
ntAudioSourceNode createMediaElementSource(HTMLMediaElement mediaElement); |
| 65 [RaisesException, MeasureAs=AudioContextCreateMediaStreamSource] MediaStream
AudioSourceNode createMediaStreamSource(MediaStream mediaStream); | 69 [RaisesException, MeasureAs=AudioContextCreateMediaStreamSource] MediaStream
AudioSourceNode createMediaStreamSource(MediaStream mediaStream); |
| 66 [RaisesException, MeasureAs=AudioContextCreateMediaStreamDestination] MediaS
treamAudioDestinationNode createMediaStreamDestination(); | 70 [RaisesException, MeasureAs=AudioContextCreateMediaStreamDestination] MediaS
treamAudioDestinationNode createMediaStreamDestination(); |
| 67 | 71 |
| 68 attribute EventHandler onstatechange; | 72 attribute EventHandler onstatechange; |
| 69 }; | 73 }; |
| OLD | NEW |