Is it possible to programmatically mute the iPhone?

白昼怎懂夜的黑 提交于 2019-11-26 11:35:43

问题


I\'ve seen techniques to make sure that an app respects the mute switch, but is it possible to set the iPhone to mute (no sounds from any apps) using the SDK?


回答1:


No.

Applications developed using the official SDK cannot change (and in most cases cannot even access) system-wide settings.




回答2:


It is possible, but only using private API's. I only went as far as muting the ringer, but you should be able to control the master level as well.

See How to disable iOS System Sounds




回答3:


It is technically possible to change the system volume through the private AVSystemController class in Celestial.framework, but will prevent your app from getting Apple's approval




回答4:


As only one app can be running at a time, the only possible use I can think of for this would be to mute other people's apps, and it should be fairly clear why Apple prevents that.

What would I do if an app muted the iPhone and I didn't know it happened? It can't physically move the mute switch on the side of the phone, so that wouldn't match, and I'd have to figure out a) that the phone was muted and b) how to unmute it without the switch.




回答5:


I can change volume using AVSystemController, it sets to minimum which is 0.06x. Is there class/API to mute it completely? toggleActiveCategoryMuted does not work



来源:https://stackoverflow.com/questions/596862/is-it-possible-to-programmatically-mute-the-iphone

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