public void LoadSong(Uri fileLocation, string songName) { //Uri songUri = new Uri(fileLocation.OriginalString + "/music.mp3", UriKind.Relative); //Music = Song.FromUri(songName, songUri); Music = BeatDetector.Instance(); Music.loadSystem(); Music.LoadSong(1024, fileLocation.OriginalString + "/music.mp3"); }
private void button1_Click(object sender, EventArgs e) { detector.loadSystem(); //electronic music most of the time needs a sample size of 2048 //music like rage against the machine works best with a sample size of 256 but still barely works detector.LoadSong(256, "ratm.mp3"); reporter = BeatReporter.GetReporterInstance(detector); Console.WriteLine("Instance initialized and loaded!"); }
private void Start_Click(object sender, EventArgs e) { if (songs.Text == "") { } else { //set difficulty SetDifficulty(difficulty.Text); delay = (280 / gamespeed); //create a new instance of beat detector and load FMOD system detector = BeatDetector.Instance(); detector.loadSystem(); //load song in array detector.LoadSong(1024, songPaths[currentSongIndex]); //delay spawn to time beats detector.loadSongToDelay(delay); //start the song detector.setStarted(true); //start gravity timer gravity.Enabled = true; gravity.Start(); //hide main menu UI start.Visible = false; songs.Visible = false; loadSongs.Visible = false; difficulty.Visible = false; topEU.SendToBack(); //show in-game UI DisplayScore(); SetHitField(); SetHitBar(); highScore.Visible = true; scoreDisplay.Visible = true; NowPlaying(); np.Visible = true; np.Text = "Now Playing:\n" + songs.Text; Focus(); } }