Advertisement
Guest User

Untitled

a guest
Oct 17th, 2017
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.71 KB | None | 0 0
  1. if (waveOut.PlaybackState == NAudio.Wave.PlaybackState.Stopped)
  2.             //if (waveOut.PlaybackState != NAudio.Wave.PlaybackState.Playing && waveOut.PlaybackState != NAudio.Wave.PlaybackState.Paused)
  3.             {
  4.                 //NAudio.Wave.WaveOut waveOut = new NAudio.Wave.WaveOut();
  5.  
  6.                 if (file.ToLower().EndsWith(".mp3") || file.ToLower().EndsWith(".wav"))
  7.                 {
  8.                     var MusicReader = new NAudio.Wave.MediaFoundationReader(file);
  9.                     waveOut.DeviceNumber = listBox1.SelectedIndex;
  10.                     waveOut.Init(MusicReader);
  11.                     waveOut.Play();
  12.                 }
  13.             }
  14.             else
  15.                 waveOut.Stop();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement