Class AudioPlayer
Plays shared SoundAssets through an OpenAL device.
public sealed class AudioPlayer : IDisposable
- Inheritance
-
AudioPlayer
- Implements
- Inherited Members
Constructors
AudioPlayer()
public AudioPlayer()
Properties
ListenerPosition
The listener position in game-defined 2D world units.
public Vector2 ListenerPosition { get; set; }
Property Value
ListenerVelocity
public Vector2 ListenerVelocity { get; set; }
Property Value
MasterVolume
public float MasterVolume { get; set; }
Property Value
Muted
public bool Muted { get; set; }
Property Value
Methods
Dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
public void Dispose()
PauseAll()
public void PauseAll()
Play(SoundAsset, bool, float, float, float)
public SoundPlayback Play(SoundAsset asset, bool loop = false, float volume = 1, float pitch = 1, float pan = 0)
Parameters
assetSoundAssetloopboolvolumefloatpitchfloatpanfloat
Returns
PlayOneShot(SoundAsset, float, float, float)
public void PlayOneShot(SoundAsset asset, float volume = 1, float pitch = 1, float pan = 0)
Parameters
assetSoundAssetvolumefloatpitchfloatpanfloat
PlayOneShotSpatial(SoundAsset, Vector2, float, float, float, float, float)
public void PlayOneShotSpatial(SoundAsset asset, Vector2 position, float volume = 1, float pitch = 1, float referenceDistance = 100, float maximumDistance = 1000, float rolloffFactor = 1)
Parameters
assetSoundAssetpositionVector2volumefloatpitchfloatreferenceDistancefloatmaximumDistancefloatrolloffFactorfloat
PlaySpatial(SoundAsset, Vector2, bool, float, float, float, float, float)
public SoundPlayback PlaySpatial(SoundAsset asset, Vector2 position, bool loop = false, float volume = 1, float pitch = 1, float referenceDistance = 100, float maximumDistance = 1000, float rolloffFactor = 1)
Parameters
assetSoundAssetpositionVector2loopboolvolumefloatpitchfloatreferenceDistancefloatmaximumDistancefloatrolloffFactorfloat
Returns
ResumeAll()
public void ResumeAll()
StopAll()
public void StopAll()