Microsoft.Xna.Framework.Audio
Class SoundEffectInstance

java.lang.Object
  extended by Microsoft.Xna.Framework.Audio.SoundEffectInstance
All Implemented Interfaces:
IDisposable
Direct Known Subclasses:
DynamicSoundEffectInstance

public class SoundEffectInstance
extends java.lang.Object
implements IDisposable

Provides a single playing, paused, or stopped instance of a SoundEffect sound.

Author:
Halofreak1990

Field Summary
 boolean IsLooped
          Gets a value that indicates whether looping is enabled for the SoundEffectInstance.
 
Method Summary
 void Apply3D(AudioListener[] listeners, AudioEmitter emitter)
          Applies 3D position to the sound using multiple listeners.
 void Apply3D(AudioListener listener, AudioEmitter emitter)
          Applies 3D positioning to the sound using a single listener.
 void Dispose()
          Releases unmanaged resources held by this SoundEffectInstance.
protected  void Dispose(boolean disposing)
          Releases the unmanaged resources held by this SoundEffectInstance, and optionally releases the managed resources.
protected  void finalize()
          Releases unmanaged resources and performs other cleanup operations before the SoundEffectInstance is reclaimed by garbage collection.
 float getPan()
          Gets the panning for the SoundEffectInstance.
 float getPitch()
          Gets the pitch adjustment for the SoundEffectInstance.
 SoundState getState()
          Gets the current state (playing, paused, or stopped) of the SoundEffectInstance.
 float getVolume()
          Gets the volume of the SoundEffectInstance.
 boolean IsDisposed()
          Gets a value that indicates whether the object is disposed.
 void Pause()
          Pauses a SoundEffectInstance.
 void Play()
          Plays or resumes a SoundEffectInstance.
 void Resume()
          Resumes playback for a SoundEffectInstance.
 void setPan(float value)
          Sets the panning for the SoundEffectInstance.
 void setPitch(float value)
          Sets the pitch adjustment for the SoundEffectInstance.
 void setVolume(float value)
          Sets the volume of the SoundEffectInstance.
 void Stop()
          Immediately stops playing a SoundEffectInstance.
 void Stop(boolean immediate)
          Stops playing a SoundEffectInstance, either immediately or as authored.
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

IsLooped

public boolean IsLooped
Gets a value that indicates whether looping is enabled for the SoundEffectInstance. Reference page contains links to related code samples.

Method Detail

IsDisposed

public boolean IsDisposed()
Gets a value that indicates whether the object is disposed.


getPan

public float getPan()
Gets the panning for the SoundEffectInstance.


setPan

public void setPan(float value)
Sets the panning for the SoundEffectInstance.


getPitch

public float getPitch()
Gets the pitch adjustment for the SoundEffectInstance. Reference page contains links to related code samples.


setPitch

public void setPitch(float value)
Sets the pitch adjustment for the SoundEffectInstance. Reference page contains links to related code samples.


getState

public SoundState getState()
Gets the current state (playing, paused, or stopped) of the SoundEffectInstance.


getVolume

public float getVolume()
Gets the volume of the SoundEffectInstance. Reference page contains links to related code samples.


setVolume

public void setVolume(float value)
Sets the volume of the SoundEffectInstance. Reference page contains links to related code samples.


Apply3D

public void Apply3D(AudioListener listener,
                    AudioEmitter emitter)
Applies 3D positioning to the sound using a single listener. Reference page contains links to related code samples.

Parameters:
listener - Position of the listener.
emitter - Position of the emitter.

Apply3D

public void Apply3D(AudioListener[] listeners,
                    AudioEmitter emitter)
Applies 3D position to the sound using multiple listeners. Reference page contains links to related code samples.

Parameters:
listeners - Positions of each listener.
emitter - Position of the emitter.

Dispose

public void Dispose()
Releases unmanaged resources held by this SoundEffectInstance.

Specified by:
Dispose in interface IDisposable

Dispose

protected void Dispose(boolean disposing)
Releases the unmanaged resources held by this SoundEffectInstance, and optionally releases the managed resources.

Parameters:
disposing - Pass true to release both the managed and unmanaged resources for this SoundEffectInstance. Passing false releases only the unmanaged resources.

finalize

protected void finalize()
Releases unmanaged resources and performs other cleanup operations before the SoundEffectInstance is reclaimed by garbage collection.

Overrides:
finalize in class java.lang.Object

Pause

public void Pause()
Pauses a SoundEffectInstance.


Play

public void Play()
Plays or resumes a SoundEffectInstance.


Resume

public void Resume()
Resumes playback for a SoundEffectInstance.


Stop

public void Stop()
Immediately stops playing a SoundEffectInstance.


Stop

public void Stop(boolean immediate)
Stops playing a SoundEffectInstance, either immediately or as authored.

Parameters:
immediate - Whether to stop playing immediately, or to break out of the loop region and play the release. Specify true to stop playing immediately, or false to break out of the loop region and play the release phase (the remainder of the sound).