Set system volume in Windows Phone 8.1

↘锁芯ラ 提交于 2019-12-12 13:33:51

问题


Can I set system volume from code behind? I know that in WP8 no way to do this. Maybe in WP8.1 ms added some api for system volume access?


回答1:


This is not possible I have tried using the WASAPI drivers from Microsoft.

As an added note quoting from MSFT support James Dailey:

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.

The above suggestion does not work.



来源:https://stackoverflow.com/questions/24383944/set-system-volume-in-windows-phone-8-1

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!