5 using SiliconStudio.Core.Mathematics;
7 namespace SiliconStudio.
Paradox.Audio
17 DataBufferLoaded =
false;
18 PlayState = SoundPlayState.Stopped;
21 #region Buffer Management
23 internal bool DataBufferLoaded;
25 private void CheckBufferNotLoaded(
string msg)
28 throw new InvalidOperationException(msg);
44 internal abstract void DestroyImpl();
46 #region IPlayableSound
48 public virtual float Volume
58 volume = MathUtil.Clamp(value, 0, 1);
65 internal abstract void UpdateVolume();
68 public virtual bool IsLooped
78 CheckBufferNotLoaded(
"The looping status of the sound can not be modified after it started playing.");
86 private bool isLooped;
87 internal abstract void UpdateLooping();
114 if (stopSiblingInstances)
115 StopConcurrentInstances();
117 if (!DataBufferLoaded)
122 DataBufferLoaded =
true;
124 PlayState = SoundPlayState.Playing;
135 internal virtual void LoadBuffer()
140 internal abstract void PlayImpl();
155 PlayState = SoundPlayState.Paused;
157 internal abstract void PauseImpl();
172 DataBufferLoaded =
false;
174 PlayState = SoundPlayState.Stopped;
176 internal abstract void StopImpl();
191 internal abstract void ExitLoopImpl();
AudioEngineState
Describe the possible states of the AudioEngine.
virtual void Play()
Start or resume playing the sound.
void PlayExtended(bool stopSiblingInstances)
Play or resume the current sound instance with extended parameters.
SoundPlayState
Current state (playing, paused, or stopped) of a sound implementing the IPlayableSound interface...
virtual void StopConcurrentInstances()
Stops the sound instances in competition with this sound instance.
AudioEngineState State
The current state of the AudioEngine.
Base class for sound that creates voices
Represents the audio engine. In current version, the audio engine necessarily creates its context on ...
Base class for all the sounds and sound instances.
virtual void Stop()
Stop playing the sound immediately and reset the sound to the beginning of the track.
override void Destroy()
Disposes of object resources.
Interface for a playable sound. A playable sound can loop (ref IsLooped), be played (ref Play)...
virtual void ExitLoop()
Stop looping. That is, do not start over at the end of the current loop, continue to play until the e...
virtual void Pause()
Pause the sounds.