mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-03 08:08:43 +00:00
LibWeb/WebAudio: Define and partially implement AnalyserNode
https://webaudio.github.io/web-audio-api/#AnalyserNode Most of the interface is naively implemented. Container types probably need adjusted (Vector<double> is used for all the processing). A Fourier Transform is needed, but that's waiting on either a 3rd party library or a complex number type. There are lots of simple miscellaneous filters that need to be applied. It could be reasonable to implement from scratch, supposing that it can be parallelized. It might be hard to find one library with everything. Not my call though. Some additional scaffolding around blocks and render quanta is probably needed before this is developed much further, which probably comes in at the level of the AudioNode. Co-authored-by: Tim Ledbetter <tim.ledbetter@ladybird.org>
This commit is contained in:
parent
50445dc9ef
commit
6c6bf322ea
Notes:
github-actions[bot]
2025-01-17 09:15:57 +00:00
Author: https://github.com/tcl3
Commit: 6c6bf322ea
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/3265
16 changed files with 911 additions and 5 deletions
25
Libraries/LibWeb/WebAudio/AnalyserNode.idl
Normal file
25
Libraries/LibWeb/WebAudio/AnalyserNode.idl
Normal file
|
@ -0,0 +1,25 @@
|
|||
#import <WebAudio/AudioNode.idl>
|
||||
#import <WebAudio/BaseAudioContext.idl>
|
||||
|
||||
// https://webaudio.github.io/web-audio-api/#AnalyserOptions
|
||||
dictionary AnalyserOptions : AudioNodeOptions {
|
||||
unsigned long fftSize = 2048;
|
||||
double maxDecibels = -30;
|
||||
double minDecibels = -100;
|
||||
double smoothingTimeConstant = 0.8;
|
||||
};
|
||||
|
||||
// https://webaudio.github.io/web-audio-api/#AnalyserNode
|
||||
[Exposed=Window]
|
||||
interface AnalyserNode : AudioNode {
|
||||
constructor (BaseAudioContext context, optional AnalyserOptions options = {});
|
||||
undefined getFloatFrequencyData (Float32Array array);
|
||||
undefined getByteFrequencyData (Uint8Array array);
|
||||
undefined getFloatTimeDomainData (Float32Array array);
|
||||
undefined getByteTimeDomainData (Uint8Array array);
|
||||
attribute unsigned long fftSize;
|
||||
readonly attribute unsigned long frequencyBinCount;
|
||||
attribute double minDecibels;
|
||||
attribute double maxDecibels;
|
||||
attribute double smoothingTimeConstant;
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue