mirror of
				https://github.com/LadybirdBrowser/ladybird.git
				synced 2025-10-31 05:10:57 +00:00 
			
		
		
		
	 6c6bf322ea
			
		
	
	
		6c6bf322ea
		
	
	
	
	
		
			
			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>
		
			
				
	
	
		
			25 lines
		
	
	
	
		
			953 B
		
	
	
	
		
			Text
		
	
	
	
	
	
			
		
		
	
	
			25 lines
		
	
	
	
		
			953 B
		
	
	
	
		
			Text
		
	
	
	
	
	
| #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;
 | |
| };
 |