views:

23

answers:

1

My silverlight code:

var stream = TitleContainer.OpenStream("Giggle.wav");
var effect = SoundEffect.FromStream(stream);
FrameworkDispatcher.Update();
effect.Play();

The file, Giggle.wav plays multiple times. I expected the code would wait while the "Play" method executes.

Suggestions to make it play one instance at a time?

Thanks

+1  A: 

How about DynamicSoundEffectInstance? Play your sound and when BufferNeeded event occurs - play next one. I am not sure but I think I saw another way how to play a sound synchronously. When I will find I will let you know.

lukas
great, thanks for the response. I will check it out tomorrow.
cbrulak