Export (0) Print
Expand All

Audio API Developers Guide

XNA Game Studio 4.0

This topic provides developers with information about the audio buffer format used by the XNA Game Studio Audio API.

Audio Buffer Format

The byte[] buffer format used as a parameter for the SoundEffect constructor, Microphone.GetData method, and DynamicSoundEffectInstance.SubmitBuffer method is PCM wave data. Additionally, the PCM format is interleaved and in little-endian.

The audio format has the following constraints:

  • The audio channels can be mono (1) or stereo (2).
  • The PCM wave file must have 16-bits per sample.
  • The sample rate must be between 8,000 Hz and 48,000 Hz.
  • The interleaving for stereo data is left channel to right channel.

Concepts

Sounds Overview
Provides a high-level overview about the capabilities of the Audio API in XNA Game Studio in addition to general audio terminology.
Playing a Sound
Demonstrates how to play a simple sound by using SoundEffect.
Streaming Data from a WAV File
Demonstrates how to stream audio from a wave (.wav) file.

Reference

SoundEffect Class
Provides a loaded sound resource.
SoundEffectInstance Class
Provides a single playing, paused, or stopped instance of a SoundEffect sound.
DynamicSoundEffectInstance Class
Provides properties, methods, and events for play back of the audio buffer.

Online Resources

Community Additions

ADD
Show:
© 2014 Microsoft