SoundEffect.GetSampleSizeInBytes Method
Microsoft Silverlight will reach end of support after October 2021. Learn more.
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)
Syntax
'Declaration
Public Shared Function GetSampleSizeInBytes ( _
duration As TimeSpan, _
sampleRate As Integer, _
channels As AudioChannels _
) As Integer
public static int GetSampleSizeInBytes(
TimeSpan duration,
int sampleRate,
AudioChannels channels
)
Parameters
- duration
Type: System.TimeSpan
The sample duration.
- sampleRate
Type: System.Int32
Sample rate, in Hertz (Hz), of audio content. The sampleRate parameter must be between 8,000 Hz and 48,000 Hz.
- channels
Type: Microsoft.Xna.Framework.Audio.AudioChannels
Number of channels in the audio data.
Return Value
Type: System.Int32
Size, in bytes, of audio sample.
Version Information
Silverlight
Supported in: 5
Platforms
For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.