O'Reilly logo

Sams Teach Yourself Windows® Phone 7 Game Programming in 24 Hours by Jonathan S. Harbour

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required