【发布时间】:2016-12-23 00:41:47
【问题描述】:
我要展示这个祝酒词,一切都很好,除了音频。我试图将 toast.mp3 放在不同的位置,如项目主文件夹、资产等,甚至使用 D:/MyProjectPath/Assets/toast.mp3 等路径,但通知仍然是无声的。我是一个初学者,所以也许我错过了一些东西......当然我一直在寻找解决方案,但没有任何帮助。这是我的代码:
string xml = $@"<toast scenario=""reminder"">
<visual>
<binding template=""ToastGeneric"">
<text>{name}</text>
<text>{quantity} {unit}</text>
<text>{beforeorafter}</text>
</binding>
</visual>
<actions>
<input id=""snoozeTime"" type=""selection"" defaultInput=""10"">
<selection id=""5"" content=""5 minutes""/>
<selection id=""10"" content=""10 minutes""/>
<selection id=""15"" content=""15 minutes""/>
</input>
<action activationType=""system"" arguments=""snooze"" hint-inputId=""snoozeTime"" content=""""/>
<action activationType=""system"" arguments=""dismiss"" content=""""/>
</actions>
<audio src = ""ms-appx:///Assets/toast.mp3"" loop = ""true""></audio>
</toast>";
【问题讨论】:
标签: c# notifications uwp toast universal