/// <summary> /// Stop Accelerometer when page is not being viewed /// </summary> protected override void OnDisappearing() { base.OnDisappearing(); Accelerometer.Stop(); bellSound = null; player = null; }
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(); }
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(); }
public static void PlayClick() { if (Preferences.Instance.PlaySound) { if (player == null) { player = Plugin.SimpleAudioPlayer.CrossSimpleAudioPlayer.Current; player.Load("tap.wav"); } player.Play(); } }
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(); }
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) { } }
/// <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>()); } }