Exemplo n.º 1
0
        private void Reset()
        {
            var buffer = CurrentAudioBuffer;

            if (_voice.State.BuffersQueued > 0)
            {
                _voice.Stop();
                _voice.FlushSourceBuffers();
            }
            _voice.SubmitSourceBuffer(buffer);
            buffer.PlayBegin = GetPlayOffset(StartingPosition.totalSeconds);
            _voice.Start();
        }
Exemplo n.º 2
0
 private void SoundSwitch_Toggled_1(object sender, RoutedEventArgs e)
 {
     if (voice != null)
     {
         var sw = sender as ToggleSwitch;
         if (sw.IsOn)
         {
             voice.Start();
         }
         else
         {
             voice.Stop();
         }
     }
 }