wp 8.1从后台任务启动声音(而不是背景但是从背景!!) [英] wp 8.1 start sound from a background task (not to backround BUT FROM BACKGROUND!!)

查看:76
本文介绍了wp 8.1从后台任务启动声音(而不是背景但是从背景!!)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述






推荐答案

我想这样做的唯一方法是从后台任务启动Toast Notification并将自定义通知声音附加到该toast(您的音频文件)。对于警报(这似乎是你的目标),这应该工作。据我所知,常规后台任务没有办法直接播放音频或与BackgroundMediaPlayer进行通信(我也建议不要使用后者,因为它会从系统的音频控件中清除用户的最后一个音乐播放器或者可能如果
用户当前正在听音乐,甚至会停止播放音乐。)
I guess the only way to do this is to launch a Toast Notification from your Background Task and attach a custom notification sound to that toast (your audio file). For alarms (which seems to be your goal) this should work. To my knowledge there is no way for a regular background task to play audio directly or to communicate with a BackgroundMediaPlayer (I also would advice against the later as it would clear the user's last music player from the system's audio controls or might even stop music playback if the user is currently listening to music).


这篇关于wp 8.1从后台任务启动声音(而不是背景但是从背景!!)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆