Export (0) Print
Expand All

SoundEffect.GetSampleDuration Method

Returns the sample duration based on the specified sample size and sample rate.

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

public static TimeSpan GetSampleDuration (
         int sizeInBytes,
         int sampleRate,
         AudioChannels channels
)

Parameters

sizeInBytes
Type: Int32
Size, in bytes, of audio data.
sampleRate
Type: Int32
Sample rate, in Hertz (Hz), of audio content. The sampleRate must be between 8000 Hz and 48000 Hz.
channels
Type: AudioChannels
Number of channels in the audio data.

Return Value

TimeSpan object that represents the calculated sample duration.

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

Community Additions

ADD
Show:
© 2014 Microsoft