Example #1
0
		public void StopSound()
		{
			if (!IsStarted) return;

			_soundOutput.StopSound();

			_outputProvider = null;

			Global.SoundMaxBufferDeficitMs = 0;

			IsStarted = false;
		}
Example #2
0
		public void StartSound()
		{
			if (_disposed) return;
			if (!Global.Config.SoundEnabled) return;
			if (IsStarted) return;

			_soundOutput.StartSound();

			_outputProvider = new SoundOutputProvider();
			_outputProvider.MaxSamplesDeficit = _soundOutput.MaxSamplesDeficit;
			_outputProvider.BaseSoundProvider = _syncSoundProvider;

			Global.SoundMaxBufferDeficitMs = (int)Math.Ceiling(SamplesToMilliseconds(_soundOutput.MaxSamplesDeficit));

			IsStarted = true;

			ApplyVolumeSettings();

			//LogUnderruns = true;
			//_outputProvider.LogDebug = true;
		}