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 O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.