mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-12 11:09:18 +00:00
LibWeb: Add BaseAudioContext.createStereoPanner()
factory method
This commit is contained in:
parent
56907e2de6
commit
5fd130b02d
Notes:
github-actions[bot]
2025-01-18 09:21:37 +00:00
Author: https://github.com/tcl3
Commit: 5fd130b02d
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/3291
6 changed files with 99 additions and 5 deletions
|
@ -160,6 +160,13 @@ WebIDL::ExceptionOr<GC::Ref<PeriodicWave>> BaseAudioContext::create_periodic_wav
|
|||
return PeriodicWave::construct_impl(realm(), *this, options);
|
||||
}
|
||||
|
||||
// https://webaudio.github.io/web-audio-api/#dom-baseaudiocontext-createstereopanner
|
||||
WebIDL::ExceptionOr<GC::Ref<StereoPannerNode>> BaseAudioContext::create_stereo_panner()
|
||||
{
|
||||
// Factory method for a StereoPannerNode.
|
||||
return StereoPannerNode::create(realm(), *this);
|
||||
}
|
||||
|
||||
WebIDL::ExceptionOr<void> BaseAudioContext::verify_audio_options_inside_nominal_range(JS::Realm& realm, float sample_rate)
|
||||
{
|
||||
if (sample_rate < MIN_SAMPLE_RATE || sample_rate > MAX_SAMPLE_RATE)
|
||||
|
|
|
@ -18,6 +18,7 @@
|
|||
#include <LibWeb/WebAudio/ConstantSourceNode.h>
|
||||
#include <LibWeb/WebAudio/DelayNode.h>
|
||||
#include <LibWeb/WebAudio/PeriodicWave.h>
|
||||
#include <LibWeb/WebAudio/StereoPannerNode.h>
|
||||
#include <LibWeb/WebIDL/Types.h>
|
||||
|
||||
namespace Web::WebAudio {
|
||||
|
@ -74,6 +75,7 @@ public:
|
|||
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 = {});
|
||||
WebIDL::ExceptionOr<GC::Ref<StereoPannerNode>> create_stereo_panner();
|
||||
|
||||
GC::Ref<WebIDL::Promise> decode_audio_data(GC::Root<WebIDL::BufferSource>, GC::Ptr<WebIDL::CallbackType>, GC::Ptr<WebIDL::CallbackType>);
|
||||
|
||||
|
|
|
@ -46,7 +46,7 @@ interface BaseAudioContext : EventTarget {
|
|||
PannerNode createPanner();
|
||||
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 ();
|
||||
StereoPannerNode createStereoPanner ();
|
||||
[FIXME] WaveShaperNode createWaveShaper ();
|
||||
|
||||
Promise<AudioBuffer> decodeAudioData (ArrayBuffer audioData, optional DecodeSuccessCallback? successCallback, optional DecodeErrorCallback? errorCallback);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue