audio : react on beats

Is there a way for corona to analyse a audio file and then tell where beats are ?

I tried to make things move on beats but get unsynchro, unless my audio file is one beat long …

Hi Antheor,
No, at this time it’s not possible to “read” and sync audio files to that level of detail, like what is done in “Beat Sneak Bandit” or similar. You could try to fully load the audio track in advance, read its beats-per-second from an audio editor, and then start a Runtime listener which constantly checks the system time (since the app started running, but taken from the delta time when the music started playing) and uses that as a “beat” check. This should actually be fairly accurate, but you’d have to test thoroughly on various devices.

Brent

Ok. Thx for the tips.

But since enterFrame is based on fps (about 33ms), it never falls on exact beats …

Hi Antheor,
No, at this time it’s not possible to “read” and sync audio files to that level of detail, like what is done in “Beat Sneak Bandit” or similar. You could try to fully load the audio track in advance, read its beats-per-second from an audio editor, and then start a Runtime listener which constantly checks the system time (since the app started running, but taken from the delta time when the music started playing) and uses that as a “beat” check. This should actually be fairly accurate, but you’d have to test thoroughly on various devices.

Brent

Ok. Thx for the tips.

But since enterFrame is based on fps (about 33ms), it never falls on exact beats …