0
votes

While experimenting with Toast Notifications, I have run into an annoying little problem. If I attempt to set the audio to looping, the notification will not play any sound at all. Using non looped sound will work just fine. I am using the code from the MSDN site like so:

  ...
  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);
  ...

And it simply will not play sound if I set the 'loop' attribute to true. I have tried manually setting 'silent' to 'false' as well as picking from different sound options listed here: http://msdn.microsoft.com/en-us/library/windows/apps/hh761492.aspx

I have confirmed that the toast are lasting for 25 seconds (as specified by the long duration) and I have tried reordering the audio attributes, all to no avail. Can anyone tell me what the heck is going on here?

1

1 Answers

0
votes

So it turns out that the toast audio is working just fine. The actual problem is admittedly odd. After digging around a lot, I found that the alarm / call / files that get used in the loops are all silent on my machine, i.e. they have no audio in them. This seemed really weird since they came from the OS installer. After more investigation, I found that each of my machines (I have two) that have an N Edition of Windows 8 installed has these silent files. My other machines, which have the normal editions have files that actually produce audio. So far I have solved the problem by changing the permissions to the "c:\windows\media" directory (something I don't like doing) and copying the real files over by hand. I plan on submitting a report to Connect, and I will post new material if I discover a less painful way to fix the issue.

UPDATE:
Installing the Media Features Pack from MS will fix the issue. The Alarm*.wav and Call*.wav audio files in C:\windows\media will have audible content. This kind of bites in my opinion because I didn't install media player for a reason, and now my N-Edition customers may experience what seems to be a bug.