performance

This commit is contained in:
Djkato 2023-02-18 19:18:00 +01:00
parent 273d212568
commit 52bc3dff87

View file

@ -9,8 +9,6 @@ audio_element.src = "Jamie xx - Sleep Sound.mp3"
let track let track
let audio_context_analyzer let audio_context_analyzer
let prev_data = new Array()
function main() { function main() {
audio_context = new AudioContext() audio_context = new AudioContext()
@ -61,19 +59,6 @@ function animate() {
path += `Z ` path += `Z `
path = `<path width="100%" height="100%" d="${path}" stroke="none" fill="#c084fc"/>` path = `<path width="100%" height="100%" d="${path}" stroke="none" fill="#c084fc"/>`
/**
* compare FFTData to previous ones
*/
let matched_amount = 0
for (let prev_dat in prev_data) {
if (prev_dat == fft_data_array) {
matched_amount += 1
}
}
console.log(`Matched ${matched_amount} times!`)
prev_data.push(fft_data_array)
svg_canvas.innerHTML = path svg_canvas.innerHTML = path
const drawVisual = requestAnimationFrame(animate) const drawVisual = requestAnimationFrame(animate)