加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > Windows > 正文

windows-phone-7 – AudioPlayerAgent不支持的API

发布时间:2020-12-14 02:45:15 所属栏目:Windows 来源:网络整理
导读:我想在我的AudioPlayerAgent中使用此 “Unsupported APIs for Background Agents”页面上列出的各种API.该页面特别提到了ScheduledTaskAgents: There is a set of APIs that cannot be used in code executed by a Scheduled Task. This includes code cont
我想在我的AudioPlayerAgent中使用此 “Unsupported APIs for Background Agents”页面上列出的各种API.该页面特别提到了ScheduledTaskAgents:

There is a set of APIs that cannot be used in code executed by a
Scheduled Task. This includes code contained in classes that implement
ScheduledTaskAgent as code in any libraries that are called from a
ScheduledTaskAgent. Some of these APIs are detected by the development
tools and will raise an error at run or compile time. Other APIs are
restricted by the Windows Phone Marketplace application submission
process.

这是否意味着AudioPlayerAgents可以使用该页面上列出的API?两者都继承了Microsoft.Phone.BackgroundAgent,但在该页面上只明确提到了一个,我不确定AudioPlayerAgent是否被认为是一个计划任务.任何人都可以确认这种或那种方式吗?

解决方法

我认为对于“后台代理不支持的API”也适用于Background Audio,但BackgroundAudioPlayer除外.我通过尝试向代理添加一个不受支持的API并针对我的测试项目运行SDK的Marketplace测试工具包(我尝试了Microsoft.Devices.VibrateController)来支持这一点.

这导致了预期的失败:

Result Details

[ERROR] : Unsupported API cannot be used by a background agent. Assembly AudioPlaybackAgent1.dll was trying to use Microsoft.Devices.VibrateController::get_Default.

[ERROR] : Unsupported API cannot be used by a background agent. Assembly AudioPlaybackAgent1.dll was trying to use Microsoft.Devices.VibrateController::Start.

[ERROR] : Unsupported API cannot be used by a background agent. Assembly AudioPlaybackAgent1.dll was trying to use Microsoft.Devices.VibrateController.

我建议你使用这个工具检查你的API,看看你得到了什么结果.

这些API限制对我有意义,因为您可以将AudioPlayerAgent视为仅在有用户输入(例如,用户按下播放,暂停,跳过)或相关音频事件发生时(例如,音轨结束,新曲目)运行的预定代理准备就绪,开始播放).背景音频代理上存在类似的CPU使用,运行时和内存限制,就像在预定代理上一样.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读