Skip to content

Instantly share code, notes, and snippets.

@jcm93

jcm93/.swift Secret

Created July 28, 2017 22:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jcm93/98be5d2878d1e4a62c6b2dc9c14e0bcb to your computer and use it in GitHub Desktop.
Save jcm93/98be5d2878d1e4a62c6b2dc9c14e0bcb to your computer and use it in GitHub Desktop.
//: Playground - noun: a place where people can play
import CoreAudio
import Foundation
var addr = AudioObjectPropertyAddress(mSelector: kAudioHardwarePropertyTransportManagerList, mScope: kAudioObjectPropertyScopeWildcard, mElement: kAudioObjectPropertyElementWildcard)
var transportManagerListSize: UInt32 = 1234
AudioObjectGetPropertyDataSize(AudioObjectID(kAudioObjectSystemObject), &addr, 0, nil, &transportManagerListSize)
transportManagerListSize
let transportManagerListCount = Int(transportManagerListSize / UInt32(MemoryLayout<UInt32>.size))
var transportManagerList = [UInt32](repeating: 1234, count: transportManagerListCount)
AudioObjectGetPropertyData(AudioObjectID(kAudioObjectSystemObject), &addr, 0, nil, &transportManagerListSize, &transportManagerList)
transportManagerList
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment