I'm looking for a not applescript way to change the system volume on Mac OS X programmatically. I just couldn't find a solution. Anyone any ideas?
            Asked
            
        
        
            Active
            
        
            Viewed 6,256 times
        
    9
            
            
        - 
                    Does Apple Event count as Apple Script for you? – bot47 Jun 08 '11 at 18:05
 - 
                    [This tutorial](http://cocoadev.com/SoundVolume) might be of assistance. – Shadikka Jun 08 '11 at 12:23
 
2 Answers
9
            
            
        Take a look at this class:
https://github.com/InerziaSoft/ISSoundAdditions
It can change system volume and make use of CoreAudio API.
An example of usage should look like this:
[NSSound setSystemVolume:0.5]
        MrAsterisco
        
- 797
 - 8
 - 21
 
- 
                    Thank you so much! This works with Yosemite unlike all the other libraries. – Matt Privman Aug 25 '14 at 19:34
 - 
                    1Thanks for sharing... is there a way to capture volume change as an event? I.e. the user changes the volume on the menu bar and my app wants to know. – mojuba Aug 06 '15 at 18:52
 - 
                    
 
4
            
            
        In case anybody is still interested in this topic: I have adapted the great ISSoundAdditions to Swift 5 and have also made its design a bit cleaner by declaring a public interface (NSSound.systemVolume)through which you can super easily manage the system sound volume through getting and setting properties (NSSound.systemVolume and NSSound.systemVolumeIsMuted). Check it out: https://github.com/mabi99/NSSound_SystemVolumeExtension
        mabi99
        
- 189
 - 1
 - 5