Microphone.GetSampleDuration Method

Returns the duration of audio playback based on the size of the 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 duration of the audio playback.

Remarks

sizeInBytes must satisfy format alignment restrictions.

Requirements

Namespace: Microsoft.Xna.Framework.Audio

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

See Also

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

Platforms

Windows Phone