public void PlaySound() { if (_waveOut == null) { SetupSound(); } _waveOut.Volume = 1.0F; _waveOut?.Play(); _waveOut?.Pause(); _waveOut?.Play(); }
public void Pause() { if (IsPlaying && !IsPaused) { player.pause(); IsPaused = true; wavePlayer?.Pause(); } }
public void Pause() { if (reader2 == null) { return; } if (wout?.PlaybackState != PlaybackState.Playing) { return; } wout?.Pause(); }
public void Pause() { if (waveOut.PlaybackState != PlaybackState.Stopped) { if (waveOut.PlaybackState == PlaybackState.Paused) { waveOut?.Play(); } else { waveOut?.Pause(); OnPause?.Invoke(new GenericEventArgs()); } } }
public void PlayPauseStream() { if (waveOut != null) { if (_streamState == StreamState.Playing) { waveOut?.Pause(); _streamState = StreamState.Paused; } else if (_streamState == StreamState.Paused) { waveOut?.Play(); _streamState = StreamState.Playing; } } }
/// <summary> /// If playing, pause. If paused, play. /// </summary> /// <returns>bool representing state: true if paused, false if playing.</returns> public bool Pause() { bool result = true; // assume it is paused if (waveOut != null) { if (waveOut.PlaybackState == PlaybackState.Playing) { waveOut.Pause(); result = true; //playbackTimer.Enabled = false; } else if (waveOut.PlaybackState == PlaybackState.Paused) { waveOut.Play(); result = false; //playbackTimer.Enabled = true; } } return(result); }
private void button_pause_Click(object sender, EventArgs e) { try { if (!isPaused) { wavePlayer.Pause(); isPaused = true; button_pause.BackgroundImage = Properties.Resources.play; pictureBox_visualisation.Image = Properties.Resources.ColorImage; } else { wavePlayer.Play(); isPaused = false; button_pause.BackgroundImage = Properties.Resources.pause; pictureBox_visualisation.Image = Properties.Resources.PlayingSound; } } catch (NullReferenceException) { MessageBox.Show("Song is not playing at the moment"); } }
public static void PauseAudioFile() { waveOutDevice?.Pause(); MusicViewModel.GetInstance().IsPlaying = false; }
public void Pause() { playbackState = StreamingPlaybackState.Buffering; waveOut.Pause(); _log.Debug(String.Format("Paused to buffer, waveOut.PlaybackState={0}", waveOut.PlaybackState)); }
public void Pause() { _soundPlayer.Pause(); }
private void PauseWithoutNotify() { _device?.Pause(); }
public void Pause() { _wavePlayer?.Pause(); }
public void Pause() { _device.Pause(); PlayerStatus = PlayerStatus.Paused; }
private void Pause() { playbackState = StreamingPlaybackState.Buffering; waveOut.Pause(); Debug.WriteLine(String.Format("Paused to buffer, waveOut.PlaybackState={0}", waveOut.PlaybackState)); }
/// <summary> /// Method that plays whatever the current song is /// </summary> private void playSong() { skipThis = false; Stream stream = Subsonic.StreamSong(currentSong.id); // Try to move this filling of memory stream into the background... Stream ms = new MemoryStream(); byte[] buffer = new byte[32768]; int read; while ((read = stream.Read(buffer, 0, buffer.Length)) > 0) { playerThread.ReportProgress(50); ms.Write(buffer, 0, read); } ms.Position = 0; Mp3FileReader mp3Reader = new Mp3FileReader(ms); WaveStream blockAlignedStream = new BlockAlignReductionStream( WaveFormatConversionStream.CreatePcmStream(mp3Reader)); WaveOut waveOut; waveOut = new WaveOut(WaveCallbackInfo.FunctionCallback()); waveOut.Init(blockAlignedStream); waveOut.Play(); playState = PlaybackState.Playing; bool songEnd = false; while (playState != PlaybackState.Stopped && !songEnd && !skipThis) { if (waveOut.PlaybackState == PlaybackState.Stopped) songEnd = true; else { switch (playState) { case PlaybackState.Paused: waveOut.Pause(); break; case PlaybackState.Playing: if (waveOut.PlaybackState != PlaybackState.Playing) waveOut.Play(); else { int progress = (int)(100.0 * mp3Reader.CurrentTime.TotalSeconds / mp3Reader.TotalTime.TotalSeconds); playerThread.ReportProgress(progress); Thread.Sleep(100); } break; default: break; } } } //if (playState == PlaybackState.Stopped) waveOut.Stop(); //waveOut.Dispose(); }
public void Pausar() { reproductorWaveOut.Pause(); }
public override void Stop() { base.Stop(); _wasapiOut.Pause(); }
public void Pause() { wavePlayer.Pause(); }
public void Pause() { wavePlayer.Pause(); _IsPlaying = false; }
public void Pause() { playbackDevice?.Pause(); }
public void Pause() { _userStopped = true; _myWaveOut.Pause(); }
public void Pause() { _wavePlayer.Pause(); Status = PlaybackStatus.Paused; }
//Pauses the current song. private void btnPause_Click(object sender, EventArgs e) { waveOutDevice.Pause(); paused = true; }
private void button6_Click(object sender, EventArgs e) //pause { waveOutDevice.Pause(); }
private void Pause() { _playbackState = StreamingPlaybackState.Buffering; _waveOut.Pause(); Debug.WriteLine("Paused to buffer, waveOut.PlaybackState={0}", _waveOut.PlaybackState); }
public void PauseSound() { _waveOut?.Pause(); }
public void Pause() { output.Pause(); PlaybackStateChanged?.Invoke(this, new EventArgs()); }
public void Pause() { player.Pause(); }
public void Pause() { waveOut.Pause(); }
private void PauseAction() { _device?.Pause(); }
private void Button_Click_1(object sender, RoutedEventArgs e) { if (player != null) { if (radio != null || radio.playState == WMPPlayState.wmppsPlaying) { playradio.Content = "Play"; radio.controls.pause(); } } if (player != null) { if (player.PlaybackState == NAudio.Wave.PlaybackState.Playing) { play.Content = "Play"; player.Pause(); } else if (player.PlaybackState == NAudio.Wave.PlaybackState.Paused || player.PlaybackState == NAudio.Wave.PlaybackState.Stopped) { play.Content = "Pause"; player.Play(); } } }