在嘗試Toast Notifications時,我遇到了一個惱人的小問題。如果我嘗試將音頻設置爲循環播放,通知根本不會播放任何聲音。使用非循環聲音將工作得很好。我使用的代碼來自MSDN網站,像這樣:Windows 8:如何在吐司通知中循環播放音頻?
...
IXmlNode toastNode = toastDoc.SelectSingleNode("/toast");
((XmlElement)toastNode).SetAttribute("duration", "long");
XmlElement audio = toastDoc.CreateElement("audio");
audio.SetAttribute("src", "ms-winsoundevent:Notification.Looping.Alarm2");
audio.SetAttribute("loop", "true");
toastNode.AppendChild(audio);
...
而且,如果我設置的「循環」屬性設置爲true根本不會播放聲音。我已嘗試手動將'silent'設置爲'false'以及從以下列出的不同聲音選項中進行選擇:http://msdn.microsoft.com/en-us/library/windows/apps/hh761492.aspx
我已經確認吐司持續25秒(如長時間指定),而且我有嘗試重新排序音頻屬性,都無濟於事。誰能告訴我這到底是怎麼回事?