SoundEffect Constructor (Byte , Int32, AudioChannels)

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

Syntax

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

Parameters

  • buffer
    Type: Byte
    Buffer that contains the audio data. The audio format must be PCM wave data.
  • sampleRate
    Type: Int32
    Sample rate, in Hertz (Hz), of audio data.
  • channels
    Type: AudioChannels
    Number of channels (mono or stereo) of audio data.

Remarks

For information about an audio format using XNA Game Studio, see Audio API Developers Guide.

Requirements

Namespace: Microsoft.Xna.Framework.Audio

Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

See Also

Concepts

Sounds Overview
Audio API Developers Guide

Reference

SoundEffect Class
SoundEffect Members
Microsoft.Xna.Framework.Audio Namespace

Platforms

Windows Phone