I struggled to find documentation for this, so I’ve blogged it here for future reference
ToastTemplateType toastTemplate = ToastTemplateType.ToastText02; XmlDocument toastXml = ToastNotificationManager.GetTemplateContent(toastTemplate); XmlNodeList toastTextElements = toastXml.GetElementsByTagName("text"); toastTextElements[0].AppendChild(toastXml.CreateTextNode(title)); toastTextElements[1].AppendChild(toastXml.CreateTextNode(message)); var audio = toastXml.CreateElement("audio"); audio.SetAttribute("src", "ms-appx:///MyAudio/CustomNotificationSound.mp3"); audio.SetAttribute("loop", "false"); toastXml.DocumentElement.AppendChild(audio); toastXml.DocumentElement.SetAttribute("launch", deepLink); ToastNotification toast81 = new ToastNotification(toastXml); ToastNotificationManager.CreateToastNotifier(MyAppId).Show(toast81);