WPF-桌面应用程序 - 吐司通知的自定义音频不起作用
我已经使用WPF创建了一个C#桌面应用程序来发送敬酒通知。显示敬酒通知时,我正在使用自己的自定义音频播放。我发现一些问题,当弹出通知窗口时,我的自定义声音没有播放。
我已经使用以下代码将自定义音频添加到我的通知中。
bool supportsCustomAudio = true;
if (AnalyticsInfo.VersionInfo.DeviceFamily.Equals("Windows.Desktop")
&& !ApiInformation.IsApiContractPresent("Windows.Foundation.UniversalApiContract", 2))
{
supportsCustomAudio = false;
}
if (supportsCustomAudio)
{
notificationBuilder.AddAudio(new Uri("ms-appx:///Assets/Audio/customaudio.mp3"));
}
我想念什么吗?有人可以帮我解决这个问题吗?
I have created a C# desktop application using WPF for sending a toast notification. I am using my own custom audio to play when the toast notification gets displayed. I found some problems where my custom sound is not getting played when the notification window is popped out.
I have used the following code to add custom audio to my notification.
bool supportsCustomAudio = true;
if (AnalyticsInfo.VersionInfo.DeviceFamily.Equals("Windows.Desktop")
&& !ApiInformation.IsApiContractPresent("Windows.Foundation.UniversalApiContract", 2))
{
supportsCustomAudio = false;
}
if (supportsCustomAudio)
{
notificationBuilder.AddAudio(new Uri("ms-appx:///Assets/Audio/customaudio.mp3"));
}
Am I missing something? Could someone please help me with the issue?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论