Partilhar via


DynamicSoundEffectInstance.GetSampleDuration Method

Returns the sample duration based on the specified size of the audio buffer.

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

Syntax

public TimeSpan GetSampleDuration (
         int sizeInBytes
)

Parameters

  • sizeInBytes
    Size, in bytes, of the audio data.

Return Value

TimeSpan object that represents the calculated sample duration.

Exceptions

Exception type Condition
ObjectDisposedException The exception that is thrown if GetSampleDuration is called after DynamicSoundEffectInstance has been disposed.

See Also

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

Platforms

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