This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from typing import List, Tuple, Dict | |
""" | |
Framebuffer's top level array contains all rows which contains all the pixels. | |
All the pixels are triplets of 8-bit RGB (Truecolour). | |
""" | |
FrameBuffer = List[List[Tuple[int]]] | |
class ImageGenerator(): | |
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** Mapping of x from range [a..b) to [c..d). */ | |
Math.map = (x, a,b, c,d) => x + (d-c)/(b-a) + c; | |
var audioCtx = new AudioContext(); | |
var source = audioCtx.createMediaElementSource( | |
document.querySelector('video') | |
); | |
var analyser = audioCtx.createAnalyser(); | |
source .connect(analyser); |