"Looking ahead" in an audio clip?

I’m prototyping a game that encourages the player to perform actions on beat. Not entirely a rhythm game but for the sake of this let’s say it is. The code is listening to a mixer channel that is only playing the kick drums. Every time the kick hits, the engine detects it. There’s a value that’s set to maximum whenever it detects a beat, then declines on a curve to the minimum again. This way, if the player is close, but slightly off, they will still get some benefit to stay on beat.

My question is this: I know how to give the player benefits from staying directly on beat, and slightly late. But how would you give the player benefits to doing something slightly before the beat hits? Is there a way I can “look ahead” while the audio clip is playing?

There are multiple approaches that could be taken. You could have a mixer channel play 1 second ahead or something it but make it silent to the player, and account for the 1 second in the code. You could pre-generate the times the beat hits and store in a file or something. You could also take inspiration from platformers Jump Buffers, which is storing a players input for a bit after they do it, so you can count the action if they pressed the button a few frames too early (like pressing the jump button 1 frame before you land).