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

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

Initializes a new instance of SoundEffect based on an audio buffer, sample rate, and number of audio channels.

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

Syntax

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

Parameters

  • buffer
    Type: array<System.Byte[]
    Buffer that contains the audio data. The audio format must be PCM wave 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.