| 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 enum AudioContextState { | 6 enum AudioContextState { |
| 7 "suspended", | 7 "suspended", |
| 8 "running", | 8 "running", |
| 9 "closed" | 9 "closed" |
| 10 }; | 10 }; |
| 11 | 11 |
| 12 [ | 12 [ |
| 13 ActiveScriptWrappable, | 13 ActiveScriptWrappable, |
| 14 DependentLifetime, | 14 DependentLifetime, |
| 15 NoInterfaceObject, | |
| 16 ] interface BaseAudioContext : EventTarget { | 15 ] interface BaseAudioContext : EventTarget { |
| 17 // All rendered audio ultimately connects to destination, which represents t
he audio hardware. | 16 // All rendered audio ultimately connects to destination, which represents t
he audio hardware. |
| 18 readonly attribute AudioDestinationNode destination; | 17 readonly attribute AudioDestinationNode destination; |
| 19 | 18 |
| 20 // All scheduled times are relative to this time in seconds. | 19 // All scheduled times are relative to this time in seconds. |
| 21 readonly attribute double currentTime; | 20 readonly attribute double currentTime; |
| 22 | 21 |
| 23 // All AudioNodes in the context run at this sample-rate (sample-frames per
second). | 22 // All AudioNodes in the context run at this sample-rate (sample-frames per
second). |
| 24 readonly attribute float sampleRate; | 23 readonly attribute float sampleRate; |
| 25 | 24 |
| (...skipping 25 matching lines...) Expand all Loading... |
| 51 [RaisesException, MeasureAs=AudioContextCreateScriptProcessor] ScriptProcess
orNode createScriptProcessor(optional unsigned long bufferSize, optional unsigne
d long numberOfInputChannels, optional unsigned long numberOfOutputChannels); | 50 [RaisesException, MeasureAs=AudioContextCreateScriptProcessor] ScriptProcess
orNode createScriptProcessor(optional unsigned long bufferSize, optional unsigne
d long numberOfInputChannels, optional unsigned long numberOfOutputChannels); |
| 52 [RaisesException, MeasureAs=AudioContextCreateStereoPanner] StereoPannerNode
createStereoPanner(); | 51 [RaisesException, MeasureAs=AudioContextCreateStereoPanner] StereoPannerNode
createStereoPanner(); |
| 53 [RaisesException, MeasureAs=AudioContextCreateOscillator] OscillatorNode cre
ateOscillator(); | 52 [RaisesException, MeasureAs=AudioContextCreateOscillator] OscillatorNode cre
ateOscillator(); |
| 54 [RaisesException, MeasureAs=AudioContextCreatePeriodicWave] PeriodicWave cre
atePeriodicWave(Float32Array real, Float32Array imag, optional PeriodicWaveConst
raints options); | 53 [RaisesException, MeasureAs=AudioContextCreatePeriodicWave] PeriodicWave cre
atePeriodicWave(Float32Array real, Float32Array imag, optional PeriodicWaveConst
raints options); |
| 55 | 54 |
| 56 // Channel splitting and merging | 55 // Channel splitting and merging |
| 57 [RaisesException, MeasureAs=AudioContextCreateChannelSplitter] ChannelSplitt
erNode createChannelSplitter(optional unsigned long numberOfOutputs); | 56 [RaisesException, MeasureAs=AudioContextCreateChannelSplitter] ChannelSplitt
erNode createChannelSplitter(optional unsigned long numberOfOutputs); |
| 58 [RaisesException, MeasureAs=AudioContextCreateChannelMerger] ChannelMergerNo
de createChannelMerger(optional unsigned long numberOfInputs); | 57 [RaisesException, MeasureAs=AudioContextCreateChannelMerger] ChannelMergerNo
de createChannelMerger(optional unsigned long numberOfInputs); |
| 59 | 58 |
| 60 // Pause/resume | 59 // Pause/resume |
| 61 [MeasureAs=AudioContextSuspend, CallWith=ScriptState, ImplementedAs=suspendC
ontext] Promise<void> suspend(); | |
| 62 [MeasureAs=AudioContextResume, CallWith=ScriptState, ImplementedAs=resumeCon
text] Promise<void> resume(); | 60 [MeasureAs=AudioContextResume, CallWith=ScriptState, ImplementedAs=resumeCon
text] Promise<void> resume(); |
| 63 | 61 |
| 64 // TODO(rtoy): These really belong to the AudioContext, but we need them | 62 // TODO(rtoy): These really belong to the AudioContext, but we need them |
| 65 // here so we can use an offline audio context to test these. | 63 // here so we can use an offline audio context to test these. |
| 66 [RaisesException, MeasureAs=AudioContextCreateMediaElementSource] MediaEleme
ntAudioSourceNode createMediaElementSource(HTMLMediaElement mediaElement); | 64 [RaisesException, MeasureAs=AudioContextCreateMediaElementSource] MediaEleme
ntAudioSourceNode createMediaElementSource(HTMLMediaElement mediaElement); |
| 67 [RaisesException, MeasureAs=AudioContextCreateMediaStreamSource] MediaStream
AudioSourceNode createMediaStreamSource(MediaStream mediaStream); | 65 [RaisesException, MeasureAs=AudioContextCreateMediaStreamSource] MediaStream
AudioSourceNode createMediaStreamSource(MediaStream mediaStream); |
| 68 [RaisesException, MeasureAs=AudioContextCreateMediaStreamDestination] MediaS
treamAudioDestinationNode createMediaStreamDestination(); | 66 [RaisesException, MeasureAs=AudioContextCreateMediaStreamDestination] MediaS
treamAudioDestinationNode createMediaStreamDestination(); |
| 69 | 67 |
| 70 attribute EventHandler onstatechange; | 68 attribute EventHandler onstatechange; |
| 71 }; | 69 }; |
| OLD | NEW |