Hour 18. Playing Audio

What You’ll Learn in This Hour:

Windows Phone audio

Simple audio playback

Adding audio content

Playing an audio clip

Audio clip length

This hour covers the loading and playing of audio files on WP7. All the code will be familiar to someone already experienced with XNA, because the same SoundEffect code can be used for audio playback in a Windows Phone game. The XNA audio system is found in the Microsoft.Xna.Framework.Audio namespace. For audio playback, we use SoundEffect and SoundEffectInstance. WP7 does not support the Cross-Platform Audio Creation Tool (XACT) or XACT projects, so we have only the simple loading and playback of audio files on WP7.

Getting Started with Windows Phone Audio

The audio system in ...

Get Sams Teach Yourself Windows® Phone 7 Game Programming in 24 Hours 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.