Esempio n. 1
0
        //do not use, only every second sound does play
        public async Task PlayAsync(SoundEfxEnum efx)
        {
            var mediaElement = effects[efx];

            await mediaElement.Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () =>
            {
                mediaElement.Stop();
                mediaElement.Position = new TimeSpan(0);
                mediaElement.Play();
            });
        }
Esempio n. 2
0
 public void Play(SoundEfxEnum efx)
 {
     try
     {
         var mediaElement = effects[efx];
         mediaElement.Play();
     }
     catch (KeyNotFoundException e)
     {
         Debug.WriteLine("DEBUG : fx not found:" + e);
     }
 }
Esempio n. 3
0
        public void Play(SoundEfxEnum efx)
        {
            var mediaElement = effects[efx];

            mediaElement.Play();
        }