diff --git a/Libraries/LibWeb/WebAudio/BaseAudioContext.cpp b/Libraries/LibWeb/WebAudio/BaseAudioContext.cpp index 55f9be57631..39a3081b3be 100644 --- a/Libraries/LibWeb/WebAudio/BaseAudioContext.cpp +++ b/Libraries/LibWeb/WebAudio/BaseAudioContext.cpp @@ -91,6 +91,12 @@ WebIDL::ExceptionOr> BaseAudioContext::create_channel return ChannelMergerNode::create(realm(), *this, options); } +// https://webaudio.github.io/web-audio-api/#dom-baseaudiocontext-createconstantsource +WebIDL::ExceptionOr> BaseAudioContext::create_constant_source() +{ + return ConstantSourceNode::create(realm(), *this); +} + // https://webaudio.github.io/web-audio-api/#dom-baseaudiocontext-createchannelsplitter WebIDL::ExceptionOr> BaseAudioContext::create_channel_splitter(WebIDL::UnsignedLong number_of_outputs) { diff --git a/Libraries/LibWeb/WebAudio/BaseAudioContext.h b/Libraries/LibWeb/WebAudio/BaseAudioContext.h index 5b0af33c46c..23e5575fc8c 100644 --- a/Libraries/LibWeb/WebAudio/BaseAudioContext.h +++ b/Libraries/LibWeb/WebAudio/BaseAudioContext.h @@ -13,6 +13,7 @@ #include #include #include +#include #include #include @@ -60,6 +61,7 @@ public: WebIDL::ExceptionOr> create_buffer(WebIDL::UnsignedLong number_of_channels, WebIDL::UnsignedLong length, float sample_rate); WebIDL::ExceptionOr> create_buffer_source(); WebIDL::ExceptionOr> create_channel_merger(WebIDL::UnsignedLong number_of_inputs); + WebIDL::ExceptionOr> create_constant_source(); WebIDL::ExceptionOr> create_channel_splitter(WebIDL::UnsignedLong number_of_outputs); WebIDL::ExceptionOr> create_oscillator(); WebIDL::ExceptionOr> create_dynamics_compressor(); diff --git a/Libraries/LibWeb/WebAudio/BaseAudioContext.idl b/Libraries/LibWeb/WebAudio/BaseAudioContext.idl index d30a663a3c5..cb28f5f53fc 100644 --- a/Libraries/LibWeb/WebAudio/BaseAudioContext.idl +++ b/Libraries/LibWeb/WebAudio/BaseAudioContext.idl @@ -36,7 +36,7 @@ interface BaseAudioContext : EventTarget { AudioBufferSourceNode createBufferSource (); ChannelMergerNode createChannelMerger (optional unsigned long numberOfInputs = 6); ChannelSplitterNode createChannelSplitter (optional unsigned long numberOfOutputs = 6); - [FIXME] ConstantSourceNode createConstantSource (); + ConstantSourceNode createConstantSource (); [FIXME] ConvolverNode createConvolver (); [FIXME] DelayNode createDelay (optional double maxDelayTime = 1.0); DynamicsCompressorNode createDynamicsCompressor();