且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

有没有办法以编程方式使OSX上的声音静音?

更新时间:2022-02-28 00:42:01

对于MAC OS X: 本教程可能会有所帮助.

对于IOS:

静音"是系统范围的设置.因此,对于使用官方SDK开发的应用程序,不能更改(在大多数情况下甚至不能访问)系统范围的设置.

Sound Mute is a system-wide setting. So for applications developed using the official SDK cannot change (and in most cases cannot even access) system-wide settings.

从技术上讲,可以通过Celestial.framework中的私有AVSystemController类更改系统容量,但会阻止您的应用获得Apple的批准.

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.