Пример #1
0
        /// <summary>
        /// Stops the sound.
        /// </summary>
        public void Stop()
        {
            if (!IsPlaying || _voice == null)
            {
                return;
            }

            if (_looped)
            {
                _voice.ExitLoop();
                _loopCount = 0;
            }
            else
            {
                _voice.Stop();
                _voice.FlushSourceBuffers();
                SoundService.DeactivateSound(this);
            }

            IsPaused  = false;
            IsPlaying = false;
            Stopped.Fire(_soundId);

            TrackPosition = TimeSpan.Zero;
        }