DynamicSoundEffectInstance.GetSampleSizeInBytes Method

Returns the size of the audio buffer required to contain audio samples based on the specified duration.

Syntax

'Declaration
Public Function GetSampleSizeInBytes ( _
         duration As TimeSpan _
) As Integer 
public int GetSampleSizeInBytes (
         TimeSpan duration
)
public:
int GetSampleSizeInBytes(
         TimeSpan duration
)

Parameters

  • duration
    Type: TimeSpan
    TimeSpan object that contains the duration of the audio sample.

Return Value

Type: Int32
Size, in bytes, of the audio buffer.

Exceptions

Exception type Condition
ObjectDisposedException The exception that is thrown if GetSampleSizeInBytes 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