If you are interested in working in OFS i made a little video tutorial back in the day. I think that you might be interested in the 3rd part about 07:10 “Audio waveform & tempo mode”. After some release there was a change in the appearence of the waveform so it might look a bit different but the idea should be the same.
https://discuss.eroscripts.com/t/how-to-script-in-openfunscripter-video-tutorial/16637