C# Class Microsoft.Xna.Framework.Audio.SoundEffectInstance

Inheritance: IDisposable
Mostra file Open project: procfxgen/MGShaderEditor Class Usage Examples

Private Properties

Property Type Description
PlatformApply3D void
PlatformDispose void
PlatformGetIsLooped bool
PlatformGetState SoundState
PlatformInitialize void
PlatformPause void
PlatformPlay void
PlatformResume void
PlatformSetIsLooped void
PlatformSetPan void
PlatformSetPitch void
PlatformSetVolume void
PlatformStop void
SoundEffectInstance System
SoundEffectInstance System
XnaPitchToAlPitch float
XnaVolumeAndPanToAndroidVolume void

Public Methods

Method Description
Apply3D ( Microsoft.Xna.Framework.Audio.AudioListener listener, Microsoft.Xna.Framework.Audio.AudioEmitter emitter ) : void

Applies 3D positioning to the SoundEffectInstance using a single listener.

Dispose ( ) : void

Releases the resources held by this Microsoft.Xna.Framework.Audio.SoundEffectInstance.

Pause ( ) : void

Pauses playback of a SoundEffectInstance.

Paused instances can be resumed with SoundEffectInstance.Play() or SoundEffectInstance.Resume().

Play ( ) : void

Plays or resumes a SoundEffectInstance.

Throws an exception if more sounds are playing than the platform allows.

Resume ( ) : void

Resumes playback for a SoundEffectInstance.

Only has effect on a SoundEffectInstance in a paused state.

Stop ( ) : void

Immediately stops playing a SoundEffectInstance.

Stop ( bool immediate ) : void

Stops playing a SoundEffectInstance, either immediately or as authored.

Stopping a sound with the immediate argument set to false will allow it to play any release phases, such as fade, before coming to a stop.

Protected Methods

Method Description
Dispose ( bool disposing ) : void

Releases the resources held by this Microsoft.Xna.Framework.Audio.SoundEffectInstance.

If the disposing parameter is true, the Dispose method was called explicitly. This means that managed objects referenced by this instance should be disposed or released as required. If the disposing parameter is false, Dispose was called by the finalizer and no managed objects should be touched because we do not know if they are still valid or not at that time. Unmanaged resources should always be released.

Private Methods

Method Description
PlatformApply3D ( AudioListener listener, AudioEmitter emitter ) : void
PlatformDispose ( bool disposing ) : void
PlatformGetIsLooped ( ) : bool
PlatformGetState ( ) : SoundState
PlatformInitialize ( byte buffer, int sampleRate, int channels ) : void

Creates a standalone SoundEffectInstance from given wavedata.

PlatformPause ( ) : void
PlatformPlay ( ) : void
PlatformResume ( ) : void
PlatformSetIsLooped ( bool value ) : void
PlatformSetPan ( float value ) : void
PlatformSetPitch ( float value ) : void
PlatformSetVolume ( float value ) : void
PlatformStop ( bool immediate ) : void
SoundEffectInstance ( ) : System
SoundEffectInstance ( byte buffer, int sampleRate, int channels ) : System
XnaPitchToAlPitch ( float xnaPitch ) : float

Converts the XNA [-1, 1] pitch range to OpenAL pitch (0, INF) or Android SoundPool playback rate [0.5, 2]. The pitch of the sound in the Microsoft XNA range.

XnaVolumeAndPanToAndroidVolume ( float xnaVolume, float xnaPan, float &leftVolume, float &rightVolume ) : void

Converts the XNA volume [0, 1] and pan [-1, 1] to Android SoundPool left and right volume [0, 1]. The volume of the sound in the Microsoft XNA range. The pan of the sound in the Microsoft XNA range. Android SoundPool left volume. Android SoundPool right volume.

Method Details

Apply3D() public method

Applies 3D positioning to the SoundEffectInstance using a single listener.
public Apply3D ( Microsoft.Xna.Framework.Audio.AudioListener listener, Microsoft.Xna.Framework.Audio.AudioEmitter emitter ) : void
listener Microsoft.Xna.Framework.Audio.AudioListener Data about the listener.
emitter Microsoft.Xna.Framework.Audio.AudioEmitter Data about the source of emission.
return void

Dispose() public method

Releases the resources held by this Microsoft.Xna.Framework.Audio.SoundEffectInstance.
public Dispose ( ) : void
return void

Dispose() protected method

Releases the resources held by this Microsoft.Xna.Framework.Audio.SoundEffectInstance.
If the disposing parameter is true, the Dispose method was called explicitly. This means that managed objects referenced by this instance should be disposed or released as required. If the disposing parameter is false, Dispose was called by the finalizer and no managed objects should be touched because we do not know if they are still valid or not at that time. Unmanaged resources should always be released.
protected Dispose ( bool disposing ) : void
disposing bool If set to true, Dispose was called explicitly.
return void

Pause() public method

Pauses playback of a SoundEffectInstance.
Paused instances can be resumed with SoundEffectInstance.Play() or SoundEffectInstance.Resume().
public Pause ( ) : void
return void

Play() public method

Plays or resumes a SoundEffectInstance.
Throws an exception if more sounds are playing than the platform allows.
public Play ( ) : void
return void

Resume() public method

Resumes playback for a SoundEffectInstance.
Only has effect on a SoundEffectInstance in a paused state.
public Resume ( ) : void
return void

Stop() public method

Immediately stops playing a SoundEffectInstance.
public Stop ( ) : void
return void

Stop() public method

Stops playing a SoundEffectInstance, either immediately or as authored.
Stopping a sound with the immediate argument set to false will allow it to play any release phases, such as fade, before coming to a stop.
public Stop ( bool immediate ) : void
immediate bool Determined whether the sound stops immediately, or after playing its release phase and/or transitions.
return void