ladybird/Libraries/LibWeb/WebAudio/BaseAudioContext.idl
Jelle Raaijmakers 35ca7f82b0
Some checks are pending
CI / Linux, x86_64, Fuzzers, Clang (push) Waiting to run
CI / Linux, x86_64, Sanitizer, GNU (push) Waiting to run
CI / Linux, x86_64, Sanitizer, Clang (push) Waiting to run
Package the js repl as a binary artifact / Linux, arm64 (push) Waiting to run
Package the js repl as a binary artifact / macOS, arm64 (push) Waiting to run
Package the js repl as a binary artifact / Linux, x86_64 (push) Waiting to run
Run test262 and test-wasm / run_and_update_results (push) Waiting to run
Lint Code / lint (push) Waiting to run
Push notes / build (push) Waiting to run
CI / macOS, arm64, Sanitizer, Clang (push) Waiting to run
Label PRs with merge conflicts / auto-labeler (push) Waiting to run
LibWeb: Add BaseAudioContext::createScriptProcessor()
This is a deprecated node, but it's still widely used on the web.
2025-07-25 11:48:04 +02:00

53 lines
2.5 KiB
Text

#import <DOM/EventTarget.idl>
#import <DOM/EventHandler.idl>
#import <WebAudio/AudioBuffer.idl>
#import <WebAudio/AudioBufferSourceNode.idl>
#import <WebAudio/AudioDestinationNode.idl>
#import <WebAudio/AudioListener.idl>
#import <WebAudio/ChannelMergerNode.idl>
#import <WebAudio/DynamicsCompressorNode.idl>
#import <WebAudio/GainNode.idl>
#import <WebAudio/OscillatorNode.idl>
#import <WebAudio/PannerNode.idl>
#import <WebIDL/DOMException.idl>
// https://www.w3.org/TR/webaudio/#enumdef-audiocontextstate
enum AudioContextState { "suspended", "running", "closed" };
callback DecodeErrorCallback = undefined (DOMException error);
callback DecodeSuccessCallback = undefined (AudioBuffer decodedData);
// https://webaudio.github.io/web-audio-api/#BaseAudioContext
[Exposed=Window]
interface BaseAudioContext : EventTarget {
readonly attribute AudioDestinationNode destination;
readonly attribute float sampleRate;
readonly attribute double currentTime;
readonly attribute AudioListener listener;
readonly attribute AudioContextState state;
// FIXME: [SameObject, SecureContext]
[FIXME] readonly attribute AudioWorklet audioWorklet;
attribute EventHandler onstatechange;
AnalyserNode createAnalyser ();
BiquadFilterNode createBiquadFilter ();
AudioBuffer createBuffer(unsigned long numberOfChannels, unsigned long length, float sampleRate);
AudioBufferSourceNode createBufferSource ();
ChannelMergerNode createChannelMerger (optional unsigned long numberOfInputs = 6);
ChannelSplitterNode createChannelSplitter (optional unsigned long numberOfOutputs = 6);
ConstantSourceNode createConstantSource ();
[FIXME] ConvolverNode createConvolver ();
DelayNode createDelay (optional double maxDelayTime = 1.0);
DynamicsCompressorNode createDynamicsCompressor();
GainNode createGain();
[FIXME] IIRFilterNode createIIRFilter (sequence<double> feedforward, sequence<double> feedback);
OscillatorNode createOscillator();
PannerNode createPanner();
PeriodicWave createPeriodicWave (sequence<float> real, sequence<float> imag, optional PeriodicWaveConstraints constraints = {});
ScriptProcessorNode createScriptProcessor(optional unsigned long bufferSize = 0, optional unsigned long numberOfInputChannels = 2, optional unsigned long numberOfOutputChannels = 2);
StereoPannerNode createStereoPanner ();
[FIXME] WaveShaperNode createWaveShaper ();
Promise<AudioBuffer> decodeAudioData (ArrayBuffer audioData, optional DecodeSuccessCallback? successCallback, optional DecodeErrorCallback? errorCallback);
};