I’m trying so sync the sound “ouch.wav” with “kinda_epik_bossbattle_theme.wav”. The thing is that it doesn’t sync, even if I have the BPM set correctly (the BPM is 86.61). Any idea on how to make this sync better?
I guess it’s a matter of finding the perfect number for the timer.
Not sure how we can help.
Why not use a sound app to create a song the same length as “kinda_epik_bossbattle_theme.wav”, and position the ouch.wav at the right intervals? Preload both pieces, and play them at the same time.
You may need to add a leading empty space to “kinda_epik_bossbattle_theme.wav” to allow for the first two plays of “ouch.wav”.
- Convert the BPM to a length of time (fraction of seconds)
- Create a beat counter and set it to zero
- Play your sound on a channel
- Read the current offset on that channel
- Divide the offset by the BPM length and truncate, and if it’s greater than the beat counter then play the sound and set the beat counter to the truncated dividend.
Right… Mind explaining me how to do it using the action/condition editor?
the closest I got to without de-syncing was 82.00000010. It seems that the 0s at the end also matter. It seems impossible to accurately determine the right number.
I used the “ouch.wav” file to see how it syncs because I actually want the scene background to change to a certain colour every 1/4th of a measure. So that’s why I am trying to make it sync with the ouch.wav file first
I didn’t think my logic was too complicated
I coded up a quick example:
The reason you want to base your logic on the song offset is because sometimes the game may slow down or your FPS might change, so you have to sync to the song.
Oh I don’t think Liluo shares the code, so here’s a zip:
i requested file access for the google drive
I updated permissions on the link to give access to anyone.