Sounds in Silverlight

Via Frank, playing sounds in Silverlight, part of a Dr. Dobb's game tutorial:

3.1.5 Playing sound effects

Playing sound effects is very simple. First we need to find the media element through its name and we stop it to ensure it is at the beginning state. Then we invoke the play method. The following code shows this approach:

var sfx =

You can play the game built in the tutorial here.

Dr. Dobb's Portal: Silverlight™ Tutorial

Technorati Tags: , ,
Skip to main content