SoundEffect.GetSampleSizeInBytes Method (Microsoft.Xna.Framework.Audio)

Returns the data size in bytes for 16bit PCM audio.

Namespace: Microsoft.Xna.Framework.Audio
Assembly: MonoGame.Framework (MonoGame.Framework.dll 3.8.0.1082)
  • C#
  • VB
  • F#
public static int GetSampleSizeInBytes(
	TimeSpan duration, 
	int sampleRate, 
	AudioChannels channels
)

Syntax for VB is not yet implemented.

Syntax for F# is not yet implemented.

Parameters

duration
Type: System.TimeSpan
The total duration of the audio data.
sampleRate
Type: System.Int32
Sample rate, in Hertz (Hz), of audio data. Must be between 8,000 and 48,000 Hz.
channels
Type: Microsoft.Xna.Framework.Audio.AudioChannels
Number of channels in the audio data.

Return Value

Type: System.Int32
The size in bytes of a single sample of audio data.
Supported in:

    
 Windows DirectX Desktop
    
 Linux Desktop
    
 Windows OpenGL Desktop
    
 Web