DynamicSoundEffectInstance.GetSampleDuration Method

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

Syntax

'Declaration
Public Function GetSampleDuration ( _
         sizeInBytes As Integer _
) As TimeSpan 
public TimeSpan GetSampleDuration (
         int sizeInBytes
)
public:
TimeSpan GetSampleDuration(
         int sizeInBytes
)

Parameters

  • sizeInBytes
    Type: Int32
    Size, in bytes, of the audio data.

Return Value

Type: TimeSpan
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.

Requirements

Namespace: Microsoft.Xna.Framework.Audio

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

See Also

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

Platforms

Windows Phone