SoundEffect Constructor (Byte[], Int32, AudioChannels)
Collapse the table of content
Expand the table of content

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)

public SoundEffect (
         byte[] 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.

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

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

Community Additions

ADD
Show:
© 2016 Microsoft