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

问题描述:

是否可以通过编程方式使OSX上的声音静音而不使用私有API并以Mac App Store接受的方式.

Is there a way to programmatically mute the sound on OSX without using private APIs and in a way that is accepted by the Mac App Store.

对于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.