Skip to content

Instantly share code, notes, and snippets.

@identity2
Created June 8, 2019 12:50
Show Gist options
  • Save identity2/17ee12433cf4362cd476cb601ef65280 to your computer and use it in GitHub Desktop.
Save identity2/17ee12433cf4362cd476cb601ef65280 to your computer and use it in GitHub Desktop.
void Start()
{
//calculate how many seconds is one beat
//we will see the declaration of bpm later
secPerBeat = 60f / bpm;
//record the time when the song starts
dsptimesong = (float) AudioSettings.dspTime;
//start the song
GetComponent<AudioSource>().Play();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment