Windows Phone 7: Media file plays multiple times before one finishes
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 "开发者_Python百科Play" method executes.
Suggestions to make it play one instance at a time?
Thanks
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.
精彩评论