Last active
February 18, 2019 16:43
-
-
Save mhamilt/235d5e4cf1f6524dc3d06cf96740b993 to your computer and use it in GitHub Desktop.
Print all Audio Unit Effects in Swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//============================================================================== | |
// Print all installed audio unit effects in Swift | |
// Handy in for debugging in a Swift console app | |
//============================================================================== | |
import Foundation | |
import AVFoundation | |
//============================================================================== | |
var availableAudioUnits = [AVAudioUnitComponent]() | |
//============================================================================== | |
func updateAudioUnitList() | |
{ | |
var componentDescription = AudioComponentDescription() | |
componentDescription.componentType = kAudioUnitType_Effect | |
componentDescription.componentSubType = 0 | |
componentDescription.componentManufacturer = 0 | |
componentDescription.componentFlags = 0 | |
componentDescription.componentFlagsMask = 0 | |
availableAudioUnits = AVAudioUnitComponentManager.shared().components(matching: componentDescription) | |
} | |
//============================================================================== | |
updateAudioUnitList() | |
for effect in availableAudioUnits | |
{ | |
print(effect.name) | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment