SoundEffect.GetSampleDuration Method

XNA Game Studio 4.0
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
Size, in bytes, of audio data.
sampleRate
Sample rate, in Hertz (Hz), of audio content. The sampleRate must be between 8000 Hz and 48000 Hz.
channels
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 7

Community Additions

ADD
Show: