예제 #1
0
        /// <summary>Initialises the SfxPlayer.</summary>
        /// <param name="sys">The system.</param>
        /// <param name="soundSystem">The sound system.</param>
        public void Initialise(Sys sys, SoundSystem soundSystem)
        {
            _sys = sys;
            _soundSystem = soundSystem;
            try { _soundSystem.Initialise(); }
            catch(Exception ex)
            {
                _sys.Log("SoundSystem failed to initialise: " + ex.Message);

                // Try to continue with no sound
                _soundSystem = new NullSoundSystem();
                _soundSystem.Initialise();
            }

            SoundSystem.Sound introSound = CreateIntroSound();

            _sampledSounds.Add(introSound);
            _speakerSounds.Add(introSound);
        }
예제 #2
0
        /// <summary>Initialises the sound system.</summary>
        /// <param name="soundSystem">The sound system.</param>
        public virtual void InitialiseSound(SoundSystem soundSystem)
        {
            _sfxPlayer.Disabled = _gameConfig.SoundDisabled;
            _sfxPlayer.SpeakerMode = _gameConfig.SoundSpeakerMode;
            _sfxPlayer.SampledSoundVolume = _gameConfig.SoundSampledSoundVolume;
            _sfxPlayer.SpeakerVolume = _gameConfig.SoundSpeakerVolume;

            _sfxPlayer.Initialise(this, soundSystem);
        }