更改系统体积的Windows Phone 8 [英] Change system volume in Windows Phone 8

查看:207
本文介绍了更改系统体积的Windows Phone 8的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

到现在为止,我觉得从您的应用程序更改系统卷是不可能的,直到最近一个名为相当时间(的http://www.windowsphone.com/en-us/store/app/quiet-hours/f347a36b-80c0-430f-8631-e55046ee5a2a),实际上是在一个非常整洁的方式做到了这一点。

Up until now I thought that changing the system volume from your app is impossible, until recently a new app called Quite Hours (http://www.windowsphone.com/en-us/store/app/quiet-hours/f347a36b-80c0-430f-8631-e55046ee5a2a) actually did just that in a very neat way.

有谁请知道该怎么做编程?我尝试使用的MediaElement或XNA的MediaPlayer和backgroundAudioPlayer并没有什么工作。任何帮助,将不胜感激!
谢谢!

Does anyone please know how to do that programmatically? I tried using the MediaElement or the xna MediaPlayer and the backgroundAudioPlayer and nothing worked. Any help would be appreciated! Thank you!

推荐答案

在OP中提到的应用程序的开发者能够改变WP8系统下的体积。 0。显然,他们使用的任何方法,现在已经在WP8.1禁用。下面的应用程序现在显示的免责声明,他们在Windows Phone 8.1不再起作用:的安静小时和的卷管理器

The developers of the apps mentioned in the OP were able to change system volume under WP8.0. Apparently whatever method they used has now been disabled under WP8.1. The following apps now display disclaimers that they no longer work on Windows Phone 8.1: Quiet Hours and Volume Manager

他们直接到以下页面进行投票,允许此功能:的 Windows Phone的开发用户音色

They direct to the following page to vote to allow this functionality: Windows Phone Dev User Voice

此外请阅读MSDN论坛下面的主题: MSDN改变系统卷的Windows Phone 8 。使用WASAPI很可能实现这个功能(这是我亲自试过了,失败了,这是行不通的,如果你想我的代码试试发表评论。),或卷的应用程序的开发者可能已经获得的 AudioClientRestricted.h 。如果一个人有这样的.h文件,人们将有机会获得下WP8.1系统的体积,所以我莫名其妙地怀疑开发人员使用指定的原始设备制造商,因为它的工作联合国8.1 .h文件。

Additionally please read the following thread on the MSDN forum: MSDN change system volume Windows Phone 8. This functionality was likely achieved using WASAPI (which I have personally tried, and failed, it does not work, comment if you want my code to try it.), or the developers of the volume apps might have had access to AudioClientRestricted.h. If one had that h file, one would have access to system volume under WP8.1, so I somehow doubt the developers used the h file designated for OEMs because it would work un 8.1.

与詹姆斯·戴利(谁的作品@ MSFT)表示这在技术上是可以使用WASAPI的 ISimpleAudioVolume 如果你读了@页面底部有指示必须使用的 IAudioEndpointVolume

Talking with James Dailey (who works @ MSFT) indicates it is technically possible using WASAPI ISimpleAudioVolume If you read @ the bottom of that page there is a comment indicating you must use IAudioEndpointVolume

补充照会詹姆斯·戴利@ MSFT:

Added note from James Dailey @ MSFT:

据我所知有操作上的
的Windows Phone 8.1在全球音频电平(WP8没有什么好办法。 1)。理论上,你可以更改使用默认的音频会话零的任何应用程序的音频
卷。但是,如果
应用选择来初始化它在您将无法访问其定制
音频会话的会话量自定义
GUID音频会话。再次,这是理论上的根据我WASAPI的
内部运作的知识。我从来没有真正尝试过的电话。结果
。要使用音频会话零你
只是以一个AudioSessionGuid参数
初始化IAudioClient操作的应用程序的音量{} 00000000-0000-0000-0000-000000000000。然后,您可以用
ISimpleAudioVolume :: SetMasterVolume设置此音频
会话量。您将需要使用C ++ / CX因为我们不支持
调用从托管代码WASAPI。

AFAIK there is no good way to manipulate the global audio level on Windows Phone 8.1 (WP8.1). Theoretically you can change the audio volume of any app that uses the default audio session "zero". However, if the app chooses to initialize it’s audio session with a custom GUID you will not have access to the session volume for its custom audio session. Again this is theoretical based on my knowledge of the inner workings of WASAPI. I’ve never actually tried it on the phone.
To manipulate the audio volume of apps using audio session "zero" you simply initialize your IAudioClient with an AudioSessionGuid parameter of "{00000000-0000-0000-0000-000000000000}". You can then use ISimpleAudioVolume::SetMasterVolume to set the volume for this audio session. You will need to use C++ / Cx since we do not support calling WASAPI from managed code.

这篇关于更改系统体积的Windows Phone 8的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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