Example #1
0
        /// <summary>
        /// Create an new instance of AudioSystem
        /// </summary>
        /// <param name="registry">The service registry in which to register the <see cref="AudioSystem"/> services</param>
        public AudioSystem(IServiceRegistry registry)
            : base(registry)
        {
            Enabled     = true;
            AudioEngine = AudioEngineFactory.NewAudioEngine();

            registry.AddService(typeof(AudioSystem), this);
        }
Example #2
0
        public override void Initialize()
        {
            base.Initialize();

            AudioEngine = AudioEngineFactory.NewAudioEngine();

            Game.Activated   += OnActivated;
            Game.Deactivated += OnDeactivated;
        }
Example #3
0
        public override void Initialize()
        {
            base.Initialize();

            lock (AudioEngineStaticLock)
            {
                if (audioEngineSingleton == null)
                {
                    audioEngineSingleton = AudioEngineFactory.NewAudioEngine(RequestedAudioDevice);
                }
                else
                {
                    ((IReferencable)audioEngineSingleton).AddReference();
                }

                AudioEngine = audioEngineSingleton;
            }

            Game.Activated   += OnActivated;
            Game.Deactivated += OnDeactivated;
        }
Example #4
0
        public override void Initialize()
        {
            base.Initialize();

            lock (AudioEngineStaticLock)
            {
                if (audioEngineSingleton == null)
                {
                    var settings = ((Game)Game)?.Settings?.Configurations?.Get <AudioEngineSettings>();
                    audioEngineSingleton = AudioEngineFactory.NewAudioEngine(RequestedAudioDevice, settings != null && settings.HrtfSupport ? AudioLayer.DeviceFlags.Hrtf : AudioLayer.DeviceFlags.None);
                }
                else
                {
                    ((IReferencable)audioEngineSingleton).AddReference();
                }

                AudioEngine = audioEngineSingleton;
            }

            Game.Activated   += OnActivated;
            Game.Deactivated += OnDeactivated;
        }