日期:2014-05-17  浏览次数:20913 次

SoundEffect问题
public partial class Round2 : PhoneApplicationPage
    {
        Stream stream = null;
        StreamResourceInfo info = Application.GetResourceStream(new Uri("Music/rain.wav", UriKind.Relative));
        DispatcherTimer timer = new DispatcherTimer();
        public Round2()
        {
            InitializeComponent();
            if (info != null)
            {
                stream = info.Stream;
            }
            SoundEffect sound = SoundEffect.FromStream(stream);
            SoundEffectInstance soundInstance = sound.CreateInstance();
        }
    }

为什么在运行SoundEffect sound = SoundEffect.FromStream(stream);时会出错,求告知原因,谢谢~

------解决方案--------------------
报什么错呢?http://www.cnblogs.com/huizhang212/archive/2012/03/12/SoundEffect.html