// Private Methods // private void StopPlayingSound() { if (_soundPlayer != null) { _soundPlayer.Stop(); } lnkPlaySound.Text = "Play Sound"; }
private void StopSound() { if (soundService != null) { soundService.Stop(); soundService = null; } }
public void PlaySounds(string[] soundFiles, EventHandler playingFinishedCallback) { CodeContract.Requires(soundFiles != null && soundFiles.Length > 0); if (_soundFiles != null) { _soundPlayer.Stop(); } else if (!QuietMode) { ProcessHelper.ExecCommand(_config.Commands.BeforePlaying); } _soundFiles = soundFiles; _currentSoundFileIndex = 0; _playingFinishedCallback = playingFinishedCallback; if (QuietMode) { _playingFinishedCallback.RaiseEvent(this); } else { _soundPlayer.Play(_soundFiles[0]); } }
private void StopAction(int soundId) { var soundEntity = _soundEntityCache[soundId]; if (soundEntity != null && soundEntity.hasAudioSourceKey) { var key = soundEntity.audioSourceKey.Value; if (_soundPlayer.IsPlaying(key)) { _soundPlayer.Stop(key); } } RemoveSoundEntity(soundId); }
/// <summary> /// Стоп плеера /// </summary> /// <returns>если плеер поставленн на стоп то true</returns> public bool StopPlayer() { _player.Stop(); return(GetPlayerStatus == SoundPlayerStatus.Stop); }