Ejemplo n.º 1
0
 /// <summary>
 /// Stop Accelerometer when page is not being viewed
 /// </summary>
 protected override void OnDisappearing()
 {
     base.OnDisappearing();
     Accelerometer.Stop();
     bellSound = null;
     player    = null;
 }
Ejemplo n.º 2
0
 public static void PlayTapEffect()
 {
     // Just in time initialisation
     if (tapEffect == null)
     {
         tapEffect = Plugin.SimpleAudioPlayer.CrossSimpleAudioPlayer.Current;
         tapEffect.Load("tap.wav");
     }
     // Play the sound
     tapEffect.Play();
 }
Ejemplo n.º 3
0
 private static async void displayPop(Plugin.SimpleAudioPlayer.ISimpleAudioPlayer player, bool check)
 {
     if (check)
     {
         await App.Current.MainPage.DisplayAlert("Wake up", "good morning", "OK");
     }
     else
     {
         await Task.Delay(new TimeSpan(0, 0, 1));
     }
     player.Stop();
 }
Ejemplo n.º 4
0
 public static void PlayClick()
 {
     if (Preferences.Instance.PlaySound)
     {
         if (player == null)
         {
             player = Plugin.SimpleAudioPlayer.CrossSimpleAudioPlayer.Current;
             player.Load("tap.wav");
         }
         player.Play();
     }
 }
Ejemplo n.º 5
0
        public static void PlayTap()
        {
            //-- Just in time initialisation

            if (tap == null)
            {
                tap = Plugin.SimpleAudioPlayer.CrossSimpleAudioPlayer.Current;
                tap.Load("tap.wav");
            }

            // - Play Sound by SoundEffects.PlayTap()

            tap.Play();
        }
Ejemplo n.º 6
0
        public static void PlayTap()
        {
            //-- Just in time initialisation

            if (player == null)
            {
                player = Plugin.SimpleAudioPlayer.CrossSimpleAudioPlayer.Current;
                player.Load("tap.wav");
            }

            if (Globals.sound == true)
            {
                //-- Play the sound with max volume.
                player.Volume = 100;
                player.Play();
            }

            if (Globals.sound == false)
            {
            }
        }
Ejemplo n.º 7
0
 /// <summary>
 /// Start Accelerometer when page is being viewed
 /// </summary>
 protected override void OnAppearing()
 {
     base.OnAppearing();
     try
     {
         Accelerometer.ReadingChanged += AccelerometerReadingChanged;
         Accelerometer.Start(speed);
         var assembly = typeof(App).GetTypeInfo().Assembly;
         bellSound = assembly.GetManifestResourceStream("Ghanta.Audio." + "Bell.mp3");
         player    = Plugin.SimpleAudioPlayer.CrossSimpleAudioPlayer.Current;
         player.Load(bellSound);
     }
     catch (FeatureNotSupportedException fnsEx)
     {
         Crashes.TrackError(fnsEx, new Dictionary <string, string>());
     }
     catch (Exception ex)
     {
         Crashes.TrackError(ex, new Dictionary <string, string>());
     }
 }