title: Using AudioToolbox from Swift to access OS X master volume
body: <p>Is there a solution to setting the system's master volume from within my Swift app?</p>
  
  <p>I read a lot about AudioToolbox and read some source examples in Objective-C. For example, I found this: <em><a href="https://stackoverflow.com/questions/25070819/setting-mac-osx-volume-programatically-using-xcode">Setting Mac OS X Volume Programatically after 10.6</a></em></p>
  
  <p>But I can't get it working in Swift.</p>
  
  <p>I am missing some example code in <a href="https://developer.apple.com/library/mac/documentation/AudioToolbox/Reference/AudioHardwareServicesReference/index.html#//apple_ref/c/func/AudioHardwareServiceGetPropertyData" rel="noreferrer">https://developer.apple.com/library/mac/documentation/AudioToolbox/Reference/AudioHardwareServicesReference/index.html#//apple_ref/c/func/AudioHardwareServiceGetPropertyData</a></p>