Windows apps
Collapse the table of content
Expand the table of content
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

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


Type: TimeSpan
TimeSpan object that contains the sample duration.
Type: Int32
Sample rate, in Hertz (Hz), of audio content. The sampleRate parameter must be between 8,000 Hz and 48,000 Hz.
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

© 2017 Microsoft