O'Reilly logo

Windows® Phone 8 Unleashed by Daniel Vaughan

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

XNA SoundEffect Class

Sometimes being a Windows Phone developer means being spoiled for choice. The XNA FCL contains various classes that you can harness in your XAML-based apps, and vice versa. One such class is the SoundEffect class, which is a lightweight class that allows you to specify an audio file and to play it from code without relying on, for example, the MediaElement control.

The SoundEffect class works well for short samples, where instant playback is required. SoundEffect provides support for controlling volume, panning, looping, and pitch of the audio, and even allows you to apply 3D audio effects. Be warned, however, that it is fussy about the format of the audio. I found that only PCM format wav files are supported. I recommend ...

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