Repository navigation
|
Hello, |
Answered by
ffd8
Feb 24, 2025
Replies: 1 comment 1 reply
|
Hey @akkolad – I moved the audio reactivity code to the backend and thooought I documented using it in the readme?? but perhaps it's only documented in the demo : demos » audio » _audio_analysis Anyways there's already an FFT object loaded, you can check out what's happening behind the scenes in p5live-audio.js – but essentially you just need to attach the function setup() {
createCanvas(windowWidth, windowHeight)
setupAudio(true) // true makes all audio variables GLOBAL, otherwise use `a5.` in front of each var
}
function draw() {
updateAudio()
// print(fftRaw.getEnergy(1000)) // debug value
clear()
circle(width / 2, height / 2, fftRaw.getEnergy(1000))
} |
1 reply
Answer selected by
ffd8
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hey @akkolad – I moved the audio reactivity code to the backend and thooought I documented using it in the readme?? but perhaps it's only documented in the demo : demos » audio » _audio_analysis
Anyways there's already an FFT object loaded, you can check out what's happening behind the scenes in p5live-audio.js – but essentially you just need to attach the
getEnergy()to the exposed variable calledfftRaw(fftis the already filtered array of values). Here's an example: