SoundEffectInstance

class SoundEffectInstance : System.Object, System.IDisposable

Represents a single instance of a playing, paused, or stopped sound.

bool IsLooped

Enables or Disables whether the SoundEffectInstance should repeat after playback.

float Pan

Gets or sets the pan, or speaker balance..

Value:Pan value ranging from -1.0 (left speaker) to 0.0 (centered), 1.0 (right speaker). Values outside of this range will throw an exception.
float Pitch

Gets or sets the pitch adjustment.

Value:Pitch adjustment, ranging from -1.0 (down an octave) to 0.0 (no change) to 1.0 (up an octave). Values outside of this range will throw an Exception.
float Volume

Gets or sets the volume of the SoundEffectInstance.

Value:Volume, ranging from 0.0 (silence) to 1.0 (full volume). Volume during playback is scaled by SoundEffect.MasterVolume.
readonly SoundState State

Gets the SoundEffectInstance’s current playback state.

readonly bool IsDisposed

Indicates whether the object is disposed.

public void Apply3D(AudioListener listener, AudioEmitter emitter)

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

Parameters:
  • listener (Microsoft.Xna.Framework.Audio.AudioListener) – Data about the listener.
  • emitter (Microsoft.Xna.Framework.Audio.AudioEmitter) – Data about the source of emission.
public void Apply3D(Microsoft.Xna.Framework.Audio.AudioListener[] listeners, AudioEmitter emitter)

Applies 3D positioning to the SoundEffectInstance using multiple listeners.

Parameters:
  • listeners (Microsoft.Xna.Framework.Audio.AudioListener[]) – Data about each listener.
  • emitter (Microsoft.Xna.Framework.Audio.AudioEmitter) – Data about the source of emission.
public void Pause()

Pauses playback of a SoundEffectInstance.

public void Play()

Plays or resumes a SoundEffectInstance.

public void Resume()

Resumes playback for a SoundEffectInstance.

public void Stop()

Immediately stops playing a SoundEffectInstance.

public void Stop(bool immediate)

Stops playing a SoundEffectInstance, either immediately or as authored.

Parameters:
  • immediate (bool) – Determined whether the sound stops immediately, or after playing its release phase and/or transitions.
public void Dispose()

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

void UpdateOutputMatrix()
System.Single[] CalculateOutputMatrix(float pan, float scale, int inputChannels)
Parameters:
  • pan (float) –
  • scale (float) –
  • inputChannels (int) –
void PlatformSetReverbMix(float mix)
Parameters:
  • mix (float) –
void PlatformSetFilter(Microsoft.Xna.Framework.Audio.FilterMode mode, float filterQ, float frequency)
Parameters:
  • mode (Microsoft.Xna.Framework.Audio.FilterMode) –
  • filterQ (float) –
  • frequency (float) –
void PlatformClearFilter()