开发者

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜