Export (0) Print
Expand All
2 out of 8 rated this helpful - Rate this topic

SoundEffectInstance Class

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

Namespace: Microsoft.Xna.Framework.Audio
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

public class SoundEffectInstance : IDisposable

You can create a SoundEffectInstance by calling SoundEffect.CreateInstance. Initially, the SoundEffectInstance is created as stopped, but you can play it by calling Play.

You can modify the volume, panning, and pitch of the SoundEffectInstance by setting the Volume, Pitch, and Pan properties.

On Windows Phone, a game can have a maximum of 16 total playing SoundEffectInstance instances at one time, combined across all loaded SoundEffect objects. The only limit to the total number of loaded SoundEffectInstance and SoundEffect objects is available memory. However, the user can play only 16 sound effects at one time. Attempts to play a SoundEffectInstance beyond this limit will fail. On Windows, there is no hard limit. Playing too many instances can lead to performance degradation. On Xbox 360, the limit is 300 sound effect instances loaded or playing. Dispose of old instances if you need more.

Dd282421.note(en-us,XNAGameStudio.41).gifNote
Unlike other platforms, the Xbox 360 has a limit to how many sound effect instances can exist in memory at one time.
Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone
Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.