5 using SiliconStudio.Core;
6 using SiliconStudio.Core.Collections;
7 using SiliconStudio.Paradox.Audio;
8 using SiliconStudio.Paradox.Games;
10 namespace SiliconStudio.
Paradox.Engine
44 internal readonly TrackingDictionary<AudioListenerComponent, AudioListener> Listeners =
new TrackingDictionary<AudioListenerComponent, AudioListener>();
50 Game.Activated += OnActivated;
51 Game.Deactivated += OnDeactivated;
62 if(!Listeners.ContainsKey(listener))
63 Listeners[listener] = null;
74 if(!Listeners.ContainsKey(listener))
75 throw new ArgumentException(
"The provided listener was not present in the Audio System.");
77 Listeners.Remove(listener);
82 base.Update(gameTime);
90 Game.Activated -= OnActivated;
91 Game.Deactivated -= OnDeactivated;
95 AudioEngine.Dispose();
99 private void OnActivated(
object sender,
EventArgs e)
102 AudioEngine.ResumeAudio();
105 private void OnDeactivated(
object sender,
EventArgs e)
108 AudioEngine.PauseAudio();
109 AudioEngine.Update();
override void Destroy()
Disposes of object resources.
Component representing an audio listener.
override void Update(GameTime gameTime)
This method is called when this game component is updated.
A service registry is a IServiceProvider that provides methods to register and unregister services...
void AddListener(AudioListenerComponent listener)
Add and activate a AudioListenerComponent to the Audio System. After this call sounds played via Audi...
Represents the audio engine. In current version, the audio engine necessarily creates its context on ...
Current timing used for variable-step (real time) or fixed-step (game time) games.
void RemoveListener(AudioListenerComponent listener)
Remove a AudioListenerComponent from the Audio System. After this call sounds played via AudioEmitter...
AudioSystem(IServiceRegistry registry)
Create an new instance of AudioSystem
The Audio System. It creates an underlying instance of AudioEngine.
override void Initialize()
This method is called when the component is added to the game.