SoundEffect Constructor (Byte , Int32, AudioChannels)

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

public SoundEffect (
         byte[] buffer,
         int sampleRate,
         AudioChannels channels
)

Parameters

  • buffer
    Buffer that contains the audio data. The audio format must be PCM wave data.
  • sampleRate
    Sample rate, in Hertz (Hz), of audio data.
  • channels
    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.

See Also

Concepts

Sounds Overview
Audio API Developers Guide

Reference

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

Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7