Search code examples
iosswiftswiftuiauv3

How to make an iOS app recognized as AudioUnit?


I'm trying to make a minimal iOS plugin from scratch. Starting from an empty iOS app (Swift 5, XCode 12.5), I thought it would suffice to add the following dict to the project's Info.plist to make it recognized as an AudioPlugin, but, having installed it, AUM (or any other AUv3 host) doesn't list the app.

What's needed to make ad app recognized as plugin?

<dict>
    <key>NSExtensionAttributes</key>
    <dict>
        <key>AudioComponents</key>
        <array>
            <dict>
                <key>description</key>
                <string>MIDIAudioUnit</string>
                <key>factoryFunction</key>
                <string>$(PRODUCT_MODULE_NAME).AudioUnitViewController</string>
                <key>manufacturer</key>
                <string>INQS</string>
                <key>name</key>
                <string>MIDIAudioUnit</string>
                <key>sandboxSafe</key>
                <true/>
                <key>subtype</key>
                <string>aumi</string>
                <key>tags</key>
                <array>
                    <string>Synthesizer</string>
                </array>
                <key>type</key>
                <string>aumi</string>
                <key>version</key>
                <real>67072</real>
            </dict>
        </array>
    </dict>
    <key>NSExtensionMainStoryboard</key>
    <string>MainInterface</string>
    <key>NSExtensionPointIdentifier</key>
    <string>com.apple.AudioUnit-UI</string>
</dict>

Solution

  • Starting from scratch:

    1. Create new/blank iOS app
    2. Add new target (type: Audio Unit Extension)
    3. Add new audio unit extension target to original parent app's target in "Frameworks, Libraries, and Embedded Content" section.

    The target you create in step 2 will be the one that has the Info.plist that has the keys you listed -- not the parent app.

    Also, make sure that your Audio Unit extension's bundle ID starts with your parent app ID:

    com.jnpdx.StackOverflowPlayground.AudioUnitParentApp //parent
    com.jnpdx.StackOverflowPlayground.AudioUnitParentApp.AudioUnit // child
    

    Assuming that your audio unit is of the "Generator" type, it'll appear in AUM under "MIDI"