private void btnOn_Click(object sender, EventArgs e)
 {
     btnOn.Visible     = false;
     btnOff.Visible    = true;
     Systeminfo.Status = false;
     Status            = false;
     Mp3Player.Pause();
 }
 private void Speek_OnExecute(string audioPath)
 {
     if (File.Exists(audioPath))
     {
         if (_mp3Player == null)
         {
             _mp3Player = new Mp3Player();
         }
         else
         {
             _mp3Player.Pause();
         }
         _mp3Player.FilePath = audioPath;
         _mp3Player.Play();
     }
 }
Beispiel #3
0
 private void OnAppbarPlayAndPauseClick(Object sender, EventArgs args)
 {
     if (!isPlayClicked)
     {
         Mp3Player.Play();
         appbarPlayAndPauseButton.IconUri = new Uri("Images/appbar.transport.pause.rest.png", UriKind.Relative);
         appbarPlayAndPauseButton.Text    = "Play";
         isPlayClicked = true;
     }
     else
     {
         Mp3Player.Pause();
         appbarPlayAndPauseButton.IconUri = new Uri("Images/appbar.transport.play.rest.png", UriKind.Relative);
         appbarPlayAndPauseButton.Text    = "Pause";
         isPlayClicked = false;
     }
 }
        public async static void PauseAsync()
        {
            if (isMp3)
            {
                if (mp3Player.State != Mp3Player.PlayingState.Playing)
                {
                    return;
                }
                paused = true;
                await Task.Run(() =>
                {
                    LowerVolume(mp3Player);
                    lock (lockObject)
                    {
                        mp3Player.Pause();
                    }
                });

                return;
            }

            if (player.State != WavePlayer.PlayingState.Playing)
            {
                return;
            }
            paused = true;
            await Task.Run(() =>
            {
                player.Volume = 1;
                for (int i = 0; i < 10; i++)
                {
                    player.Volume -= ((double)1 / 10);
                    Thread.Sleep(150);
                }
                lock (lockObject)
                {
                    player.Pause();
                }
            });
        }
 public void PauseMix() => _mp3Player?.Pause();
 /// <summary>
 /// Pauses the playback
 /// </summary>
 public void Pause()
 {
     player.Pause();
 }
 private void btnPause_Click(object sender, RoutedEventArgs e)
 {
     mp3Player.Pause();
 }