How to do something every x seconds based on audio's track position

Discussion in 'Programming' started by CKlidify, Mar 18, 2017.

  1. CKlidify

    CKlidify Member

    Joined:
    Nov 22, 2016
    Posts:
    9
    I'm trying to make a rhythm game and right now I have an alarm that triggers every 0.43 seconds to go along with the song but that can go out of sync after a while and there are parts in the game where the music will slow down or speed up respectively and everything will go out of sync.

    I was wondering if I could just make the code run every 0.43 seconds based on the track position of the audio that's playing. If someone could help me figure this out it would be greatly appreciated!
     
  2. Storyteller

    Storyteller Member

    Joined:
    Jul 19, 2016
    Posts:
    251
    audio_sound_get_track_position
    might help. you could test that each step and check where it is,
    then use audio_sound_get_pitch or get_gain to check for your beats? Id almost say you need a map file to the track to align beats you need to hit to beats in the song.
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice