コード例 #1
0
        private void tmrUpdate_Tick(object sender, EventArgs e)
        {
            if ((_isPlaying) && (CurrentBuffer != null))
            {
                CurrentBuffer.Fill();

                trackBarPosition.Value = CurrentBuffer.ReadSample;

                if (!_loop)
                {
                    if (CurrentBuffer.ReadSample >= _targetStream.Samples)
                    {
                        Stop();
                        AudioEnded?.Invoke(this, new EventArgs());
                    }
                }
            }
        }
コード例 #2
0
ファイル: AudioEngine.cs プロジェクト: me66ccff/FrostPlay
 public AudioEngine()
 {
     if (WasapiOut.IsSupportedOnCurrentPlatform)
     {
         soundOut = new WasapiOut();
     }
     else
     {
         soundOut = new DirectSoundOut();
     }
     soundOut.Stopped += (s, args) =>
     {
         if (soundOut.PlaybackState == PlaybackState.Stopped)
         {
             AudioEnded?.Invoke(this, null);
         }
     };
 }
コード例 #3
0
 private void app_AudioEnded(object sender, EventArgs e)
 {
     AudioEnded?.Invoke(this, e);
 }