mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-22 02:09:24 +00:00
LibWeb: Add BaseAudioContext.create_periodic_wave()
factory method
This commit is contained in:
parent
f90b79fa1f
commit
a6f04506e4
Notes:
github-actions[bot]
2025-01-03 13:55:11 +00:00
Author: https://github.com/tcl3
Commit: a6f04506e4
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/3104
5 changed files with 179 additions and 1 deletions
|
@ -134,6 +134,17 @@ WebIDL::ExceptionOr<GC::Ref<PannerNode>> BaseAudioContext::create_panner()
|
|||
return PannerNode::create(realm(), *this);
|
||||
}
|
||||
|
||||
WebIDL::ExceptionOr<GC::Ref<PeriodicWave>> BaseAudioContext::create_periodic_wave(Vector<float> const& real, Vector<float> const& imag, Optional<PeriodicWaveConstraints> const& constraints)
|
||||
{
|
||||
PeriodicWaveOptions options;
|
||||
options.real = real;
|
||||
options.imag = imag;
|
||||
if (constraints.has_value())
|
||||
options.disable_normalization = constraints->disable_normalization;
|
||||
|
||||
return PeriodicWave::construct_impl(realm(), *this, options);
|
||||
}
|
||||
|
||||
// https://webaudio.github.io/web-audio-api/#dom-baseaudiocontext-createbuffer
|
||||
WebIDL::ExceptionOr<void> BaseAudioContext::verify_audio_options_inside_nominal_range(JS::Realm& realm, WebIDL::UnsignedLong number_of_channels, WebIDL::UnsignedLong length, float sample_rate)
|
||||
{
|
||||
|
|
|
@ -15,6 +15,7 @@
|
|||
#include <LibWeb/WebAudio/ChannelMergerNode.h>
|
||||
#include <LibWeb/WebAudio/ChannelSplitterNode.h>
|
||||
#include <LibWeb/WebAudio/ConstantSourceNode.h>
|
||||
#include <LibWeb/WebAudio/PeriodicWave.h>
|
||||
#include <LibWeb/WebIDL/Types.h>
|
||||
|
||||
namespace Web::WebAudio {
|
||||
|
@ -67,6 +68,7 @@ public:
|
|||
WebIDL::ExceptionOr<GC::Ref<DynamicsCompressorNode>> create_dynamics_compressor();
|
||||
WebIDL::ExceptionOr<GC::Ref<GainNode>> create_gain();
|
||||
WebIDL::ExceptionOr<GC::Ref<PannerNode>> create_panner();
|
||||
WebIDL::ExceptionOr<GC::Ref<PeriodicWave>> create_periodic_wave(Vector<float> const& real, Vector<float> const& imag, Optional<PeriodicWaveConstraints> const& constraints = {});
|
||||
|
||||
GC::Ref<WebIDL::Promise> decode_audio_data(GC::Root<WebIDL::BufferSource>, GC::Ptr<WebIDL::CallbackType>, GC::Ptr<WebIDL::CallbackType>);
|
||||
|
||||
|
|
|
@ -44,7 +44,7 @@ interface BaseAudioContext : EventTarget {
|
|||
[FIXME] IIRFilterNode createIIRFilter (sequence<double> feedforward, sequence<double> feedback);
|
||||
OscillatorNode createOscillator();
|
||||
PannerNode createPanner();
|
||||
[FIXME] PeriodicWave createPeriodicWave (sequence<float> real, sequence<float> imag, optional PeriodicWaveConstraints constraints = {});
|
||||
PeriodicWave createPeriodicWave (sequence<float> real, sequence<float> imag, optional PeriodicWaveConstraints constraints = {});
|
||||
[FIXME] ScriptProcessorNode createScriptProcessor(optional unsigned long bufferSize = 0, optional unsigned long numberOfInputChannels = 2, optional unsigned long numberOfOutputChannels = 2);
|
||||
[FIXME] StereoPannerNode createStereoPanner ();
|
||||
[FIXME] WaveShaperNode createWaveShaper ();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue