public override void LoadContent() { song = Content.Load<Song>("Short Disco"); song.HintBeginPreload(); soundEffect = Content.Load<SoundEffect>("ding"); loop = Content.Load<SoundEffect>("motor").CreateInstance(); loop.IsLooped = true; }
public static void Play(Song song) { Stop(); currentSong = song; currentSong.HintBeginPreload(); // creates currentSong.sound // If the download hasn't fully connected, Play will do nothing. AutoPlay will cause the song to start when it is ready: currentSong.sound.mediaElement.AutoPlay = true; SetSongVolume(); if(isRepeating) SetSongRepeatHandler(); currentSong.sound.Play(); }
public static void Play(Song song) { Stop(); currentSong = song; currentSong.HintBeginPreload(); // creates currentSong.sound // If the download hasn't fully connected, Play will do nothing. AutoPlay will cause the song to start when it is ready: currentSong.sound.mediaElement.AutoPlay = true; SetSongVolume(); if (isRepeating) { SetSongRepeatHandler(); } currentSong.sound.Play(); }