Recording Audio with the Microphone

The XNA Microphone class allows you to capture audio data from the phone’s microphone. Microphone resides in the Microsoft.Xna.Framework.Audio namespace.

To use the Microphone class you need to create a GameTimer to pump the XNA FrameworkDispatcher. XNA components usually rely on initialization of the XNA environment before they can be used, and the Microphone class is no exception. Creating a GameTimer to pump the XNA FrameworkDispatcher normally involves adding some code to your App class that creates a GameTimer and subscribes to its FrameAction event. For more information on initializing the XNA environment, see Chapter 7, “Employing Media and Web Elements.”

Microphone does not have a public constructor; ...

Get Windows® Phone 8 Unleashed now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.