Ejemplo n.º 1
0
 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;
 }
Ejemplo n.º 2
0
        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();
        }
Ejemplo n.º 3
0
        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();
        }