SoundEffect.GetSampleSizeInBytes Method

Returns the size of the audio sample based on duration, sample rate, and audio channels.

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

public static int GetSampleSizeInBytes (
         TimeSpan duration,
         int sampleRate,
         AudioChannels channels
)

Parameters

duration
Type: TimeSpan
TimeSpan object that contains the sample duration.
sampleRate
Type: Int32
Sample rate, in Hertz (Hz), of audio content. The sampleRate parameter must be between 8,000 Hz and 48,000 Hz.
channels
Type: AudioChannels
Number of channels in the audio data.

Return Value

Size, in bytes, of audio sample.

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

Community Additions

ADD
Show: