diff --git a/Libraries/LibWeb/WebAudio/BaseAudioContext.cpp b/Libraries/LibWeb/WebAudio/BaseAudioContext.cpp index e4bd3cf7e9b..8c7cfc98b29 100644 --- a/Libraries/LibWeb/WebAudio/BaseAudioContext.cpp +++ b/Libraries/LibWeb/WebAudio/BaseAudioContext.cpp @@ -96,6 +96,15 @@ WebIDL::ExceptionOr> BaseAudioContext::create_consta return ConstantSourceNode::create(realm(), *this); } +// https://webaudio.github.io/web-audio-api/#dom-baseaudiocontext-createdelay +WebIDL::ExceptionOr> BaseAudioContext::create_delay(double max_delay_time) +{ + DelayOptions options; + options.max_delay_time = max_delay_time; + + return DelayNode::create(realm(), *this, options); +} + // 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 a2d05032593..52c05617f54 100644 --- a/Libraries/LibWeb/WebAudio/BaseAudioContext.h +++ b/Libraries/LibWeb/WebAudio/BaseAudioContext.h @@ -15,6 +15,7 @@ #include #include #include +#include #include #include @@ -64,6 +65,7 @@ public: 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_delay(double max_delay_time = 1); WebIDL::ExceptionOr> create_oscillator(); WebIDL::ExceptionOr> create_dynamics_compressor(); WebIDL::ExceptionOr> create_gain(); diff --git a/Libraries/LibWeb/WebAudio/BaseAudioContext.idl b/Libraries/LibWeb/WebAudio/BaseAudioContext.idl index 668a9400443..543939d4694 100644 --- a/Libraries/LibWeb/WebAudio/BaseAudioContext.idl +++ b/Libraries/LibWeb/WebAudio/BaseAudioContext.idl @@ -38,7 +38,7 @@ interface BaseAudioContext : EventTarget { ChannelSplitterNode createChannelSplitter (optional unsigned long numberOfOutputs = 6); ConstantSourceNode createConstantSource (); [FIXME] ConvolverNode createConvolver (); - [FIXME] DelayNode createDelay (optional double maxDelayTime = 1.0); + DelayNode createDelay (optional double maxDelayTime = 1.0); DynamicsCompressorNode createDynamicsCompressor(); GainNode createGain(); [FIXME] IIRFilterNode createIIRFilter (sequence feedforward, sequence feedback);