Paradox Game Engine  v1.0.0 beta06
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros Pages
SiliconStudio.Paradox.Audio.SoundMusic Class Reference

This class provides a sound resource which is playable but not localizable. More...

Inheritance diagram for SiliconStudio.Paradox.Audio.SoundMusic:
SiliconStudio.Paradox.Audio.SoundInstanceBase SiliconStudio.Paradox.Audio.SoundBase SiliconStudio.Paradox.Audio.IPlayableSound SiliconStudio.Core.ComponentBase SiliconStudio.Core.IComponent SiliconStudio.Core.ICollectorHolder SiliconStudio.Core.IReferencable SiliconStudio.Core.IReferencable

Static Public Member Functions

static SoundMusic Load (AudioEngine engine, Stream stream)
 Create and Load a sound music from an input file. More...
 

Additional Inherited Members

- Public Member Functions inherited from SiliconStudio.Paradox.Audio.SoundInstanceBase
virtual void Play ()
 Start or resume playing the sound. More...
 
virtual void Pause ()
 Pause the sounds. More...
 
virtual void Stop ()
 Stop playing the sound immediately and reset the sound to the beginning of the track. More...
 
virtual void ExitLoop ()
 Stop looping. That is, do not start over at the end of the current loop, continue to play until the end of the buffer data and then stop. More...
 
- Public Member Functions inherited from SiliconStudio.Core.ComponentBase
void Dispose ()
 
override string ToString ()
 
- Public Attributes inherited from SiliconStudio.Core.ComponentBase
PropertyContainer Tags
 Gets the attached properties to this component. More...
 
- Protected Member Functions inherited from SiliconStudio.Paradox.Audio.SoundInstanceBase
override void Destroy ()
 Disposes of object resources. More...
 
void PlayExtended (bool stopSiblingInstances)
 Play or resume the current sound instance with extended parameters. More...
 
virtual void StopConcurrentInstances ()
 Stops the sound instances in competition with this sound instance. More...
 
- Protected Member Functions inherited from SiliconStudio.Core.ComponentBase
 ComponentBase ()
 Initializes a new instance of the ComponentBase class. More...
 
 ComponentBase (string name)
 Initializes a new instance of the ComponentBase class. More...
 
virtual void OnNameChanged ()
 Called when Name property was changed. More...
 
- Properties inherited from SiliconStudio.Paradox.Audio.SoundInstanceBase
virtual float Volume [get, set]
 
virtual bool IsLooped [get, set]
 
virtual SoundPlayState PlayState [get, set]
 
- Properties inherited from SiliconStudio.Core.ComponentBase
long Id [get, set]
 
string Name [get, set]
 Gets or sets the name of this component. More...
 
bool IsDisposed [get, set]
 Has the component been disposed or not yet. More...
 
- Properties inherited from SiliconStudio.Core.IComponent
long Id [get]
 Gets the id of this component. More...
 
string Name [get]
 Gets the name of this component. More...
 
- Properties inherited from SiliconStudio.Core.IReferencable
int ReferenceCount [get]
 Gets the reference count of this instance. More...
 
- Properties inherited from SiliconStudio.Core.ICollectorHolder
ObjectCollector Collector [get]
 Gets the collector. More...
 
- Properties inherited from SiliconStudio.Paradox.Audio.IPlayableSound
SoundPlayState PlayState [get]
 The current state of the sound. More...
 
bool IsLooped [get, set]
 Does the sound is automatically looping from beginning when it reaches the end. More...
 
float Volume [get, set]
 The global volume at which the sound is played. More...
 

Detailed Description

This class provides a sound resource which is playable but not localizable.

SoundMusics are usually "long" sounds that need neither to be localized nor to be played with low latency. Classical examples are background music or explanations. SoundMusics are progressively streamed to minimize memory usage. The user can also reduce the assets global size using the MP3 file format to encode SoundMusic. If low latency or sound localization is required take a look at the SoundEffect or DynamicSoundEffectInstance classes.

Only one instance of SoundMusic can be played at a time. Thus, playing a new SoundMusic stops the previous instance.

You can create a SoundMusics by calling the static Load load function. Currently only mono and stereo wav and mp3 files are supported for SoundMusics.

See also
SoundEffect, IPlayableSound, DynamicSoundEffectInstance

Definition at line 29 of file SoundMusic.cs.

Member Function Documentation

static SoundMusic SiliconStudio.Paradox.Audio.SoundMusic.Load ( AudioEngine  engine,
Stream  stream 
)
static

Create and Load a sound music from an input file.

Parameters
engineThe audio engine in which to load the soundMusic
streamThe stream.
Returns
A new instance of soundMusic ready to be played
Exceptions
System.ArgumentNullExceptionengine or filename
System.ObjectDisposedExceptionThe AudioEngine in which to create the voice is disposed.
System.ArgumentExceptionengine or stream
ObjectDisposedExceptionThe AudioEngine in which to create the voice is disposed.
ArgumentNullExceptionFile ' + filename + ' does not exist.

On all platform the wav format is supported. For compressed formats, it is the task of the build engine to automatically adapt the original files to the best hardware specific format.

Definition at line 54 of file SoundMusic.cs.

References SiliconStudio.Core.ComponentBase.IsDisposed.


The documentation for this class was generated from the following file: