Sdílet prostřednictvím


Working with Microphones

This section provides basic concepts of microphone usage for XNA Game Studio 4.0 Refresh-enabled games.

Supported Microphone Devices

The following microphone types are supported on Windows:

  • Xbox 360 headset
  • Devices recognized by the operating system as microphones (including USB microphones and devices connected through the microphone jack)

The following microphone types are supported on Xbox 360:

  • Xbox 360 wired and wireless headset
  • Lips microphone
  • Rock Band/Guitar Hero microphone

The following microphone types are supported on Windows Phone:

  • Bluetooth-enabled headset
  • Mobile phone's built-in microphone
  • Microphones connected through the headset jack

Introducing the XNA Game Studio 4.0 Refresh Microphone API

The XNA Game Studio 4.0 Refresh Microphone API has the following functionality:

  • Captures the audio stream from a microphone or a headset.
  • Provides microphone enumeration.
  • Submits and controls a stream of audio buffers for playback using the DynamicSoundEffectInstance object.
  • Plays back audio through a headset.
  • Provides a cross-platform API for Windows and Windows Phone.

Microphone API Process Workflow

The Microphone API behaves like a simple audio recorder with a configurable capture buffer. It has been designed with the following development process workflow:

  1. Select the microphone connected to the device.
  2. Configure the microphone's capture buffer size.
  3. Control the recording using standard transport controls (Start and Stop).
  4. Retrieve the captured audio using the GetData method.

Also, you can use the BufferReady event handler if you want to be notified when the audio capture buffer is ready to be processed.

Concepts

  • Creating and Playing Sounds
    Provides overviews about audio technology, and presents predefined scenarios to demonstrate how to use audio.
  • Voice Support
    Introduces the voice support options available in the XNA Framework.

Reference

  • DynamicSoundEffectInstance
    Provides properties, methods, and events for play back of the audio buffer.
  • Microphone
    Provides properties, methods, and fields and events for capturing audio data with microphones.