Permalink
Browse files

Add createAnalyser

  • Loading branch information...
Manishearth committed Sep 14, 2018
1 parent 7440c18 commit 89cb89a2c91ae32f30466beeb6864a8dde97a73b
@@ -2,13 +2,15 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
use dom::analysernode::AnalyserNode;
use dom::audiobuffer::AudioBuffer;
use dom::audiobuffersourcenode::AudioBufferSourceNode;
use dom::audiodestinationnode::AudioDestinationNode;
use dom::audiolistener::AudioListener;
use dom::audionode::MAX_CHANNEL_COUNT;
use dom::bindings::callback::ExceptionHandling;
use dom::bindings::cell::DomRefCell;
use dom::bindings::codegen::Bindings::AnalyserNodeBinding::AnalyserOptions;
use dom::bindings::codegen::Bindings::AudioBufferSourceNodeBinding::AudioBufferSourceOptions;
use dom::bindings::codegen::Bindings::AudioNodeBinding::{ChannelCountMode, ChannelInterpretation};
use dom::bindings::codegen::Bindings::AudioNodeBinding::AudioNodeOptions;
@@ -337,6 +339,11 @@ impl BaseAudioContextMethods for BaseAudioContext {
PannerNode::new(&self.global().as_window(), &self, &PannerOptions::empty())
}
/// https://webaudio.github.io/web-audio-api/#dom-baseaudiocontext-createanalyser
fn CreateAnalyser(&self) -> Fallible<DomRoot<AnalyserNode>> {
AnalyserNode::new(&self.global().as_window(), &self, &AnalyserOptions::empty())
}
/// https://webaudio.github.io/web-audio-api/#dom-baseaudiocontext-createchannelmerger
fn CreateChannelMerger(&self, count: u32) -> Fallible<DomRoot<ChannelMergerNode>> {
let mut opts = ChannelMergerOptions::empty();
@@ -35,7 +35,7 @@ interface BaseAudioContext : EventTarget {
// ScriptProcessorNode createScriptProcessor(optional unsigned long bufferSize = 0,
// optional unsigned long numberOfInputChannels = 2,
// optional unsigned long numberOfOutputChannels = 2);
// AnalyserNode createAnalyser();
[Throws] AnalyserNode createAnalyser();
[Throws] GainNode createGain();
// DelayNode createDelay(optional double maxDelayTime = 1);
// BiquadFilterNode createBiquadFilter();

0 comments on commit 89cb89a

Please sign in to comment.