开发者

Windows Phone 7: Media file plays multiple times before one finishes

开发者 https://www.devze.com 2023-01-22 21:05 出处:网络
My silverlight code: var stream = TitleContainer.OpenStream(\"Giggle.wav\"); var effect = SoundEffect.FromStream(stream);

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

精彩评论

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