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

Create a sound effect.

Namespace: Microsoft.Xna.Framework.Audio
Assembly: MonoGame.Framework (MonoGame.Framework.dll 3.8.0.1082)
  • C#
  • VB
  • F#
public SoundEffect(
	Byte[] buffer, 
	int offset, 
	int count, 
	int sampleRate, 
	AudioChannels channels, 
	int loopStart, 
	int loopLength
)

Syntax for VB is not yet implemented.

Syntax for F# is not yet implemented.

Parameters

buffer
Type: System.Byte[]
The buffer with the sound data.
offset
Type: System.Int32
The offset to the start of the sound data in bytes.
count
Type: System.Int32
The length of the sound data in bytes.
sampleRate
Type: System.Int32
The sound data sample rate in hertz.
channels
Type: Microsoft.Xna.Framework.Audio.AudioChannels
The number of channels in the sound data.
loopStart
Type: System.Int32
The position where the sound should begin looping in samples.
loopLength
Type: System.Int32
The duration of the sound data loop in samples.
This only supports uncompressed 16bit PCM wav data.
Supported in:

    
 Windows DirectX Desktop
    
 Linux Desktop
    
 Windows OpenGL Desktop
    
 Web