AudioKit on macOS: get/set system device volume

2019-09-25 11:02发布

问题:

I've used AudioKit.inputDevice, Audiotkit.outputDevice, and friends to get get all input and output devices on my Mac, and to get/set default input and output device.

I wish to read the current volume of these devices, and to be able to set it myself, but I can't find the correct AudioKit API for doing so.

Does anyone know how to do this?

回答1:

You will want to use a library similar to https://github.com/InerziaSoft/ISSoundAdditions

Changing sound volume becomes as simple as:

[NSSound setSystemVolume:0.5]

-- Duplicate of: Change Volume on Mac programmatically