SoundEffect.Duration Property

Gets the duration of the SoundEffect.

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


public TimeSpan Duration { get; }

Property Value

A TimeSpan that represents the duration of the SoundEffect.


This is a read-only property. The sound duration is initialized from the sound file and cannot be changed. For information about authoring and adding sound files, see Adding a Sound File (XACT).

See Also


SoundEffect Class
SoundEffect Members
Microsoft.Xna.Framework.Audio Namespace


Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone