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