SoundEffect Constructor (array<Byte[], Int32, Int32, Int32, AudioChannels, Int32, Int32)

Microsoft Silverlight will reach end of support after October 2021. Learn more.

Initializes a new instance of SoundEffect with specified parameters such as audio sample rate, channels, looping criteria, and a buffer to hold the audio.

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

Syntax

'Declaration
Public Sub New ( _
    buffer As Byte(), _
    offset As Integer, _
    count As Integer, _
    sampleRate As Integer, _
    channels As AudioChannels, _
    loopStart As Integer, _
    loopLength As Integer _
)
public SoundEffect(
    byte[] buffer,
    int offset,
    int count,
    int sampleRate,
    AudioChannels channels,
    int loopStart,
    int loopLength
)

Parameters

  • buffer
    Type: array<System.Byte[]
    Buffer that contains the audio data. The audio format must be PCM wave data.
  • offset
    Type: System.Int32
    Offset, in bytes, to the starting position of the audio data.
  • sampleRate
    Type: System.Int32
    Sample rate, in Hertz (Hz), of audio data.

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.