AudioPlayerAgent不支持的API

时间:2012-02-02 00:03:31

标签: windows-phone-7 windows-phone-7.1 windows-phone

我想在我的AudioPlayerAgent内使用此"Unsupported APIs for Background Agents"页面上列出的各种API。该页面专门提到了ScheduledTaskAgents

  

有一组API无法在由a执行的代码中使用   预定任务。这包括实现的类中包含的代码   ScheduledTaskAgent作为从a调用的任何库中的代码   ScheduledTaskAgent。开发会检测到其中一些API   工具,并将在运行或编译时引发错误。其他API是   受Windows Phone Marketplace应用程序提交限制   过程

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

1 个答案:

答案 0 :(得分:1)

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

这导致了预期的失败:

  

结果明细

     

[错误]:后台代理无法使用不支持的API。程序集AudioPlaybackAgent1.dll试图使用Microsoft.Devices.VibrateController :: get_Default。

     

[错误]:后台代理无法使用不支持的API。程序集AudioPlaybackAgent1.dll试图使用Microsoft.Devices.VibrateController :: Start。

     

[错误]:后台代理无法使用不支持的API。程序集AudioPlaybackAgent1.dll试图使用Microsoft.Devices.VibrateController。

我建议您根据此工具检查您的API,看看您得到的结果。

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