[p5.js Sound] Setting time between which amp.getLevel returns values

Screenshot 2021-07-17 at 10.36.39
Hi, I am trying to get the amplitude of an audio file, to render something similar to the attached screenshot. I want to show the amp every 100ms only. If I understand correctly, amp.getLevel is called every time a new frame is rendered. Is there a way I can control in how many seconds do I wish to get the value of the amplitude? I can try setting frameRate(10), but that makes the visual look rather laggy.

What I am trying to do can be understood by looking at the visual of Apple’s Voice Memos Demo link on YouTube from 00:46 - 00:50

hi! welcome to the forum.

sounds like what you want to do is to scan the entire file at first rather than analyzing on the fly. I haven’t tried it yet but getPeaks might do the exact job what you’re looking for!