Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Inter-App Audio : can't even connect my node

Tags:

ios

core-audio

well, I am trying to implement IAA into my iOS app and have carefully studied the Apple "InterAppAudioSuite" as well as the WWDCXIII 602 video for that matter. My app behaves like the Apple InterAppAudioSampler and I have used as much code as possible from this example.

My app starts and I get a "AudioOutputUnitPublish stub called" message in the log window that says - I guess - that things are ok . I then launch the "InterAppAudioHost" app from Apple and try to connect my app (that acts as an audio Remote instrument). My app is available in the App list. But then it fails to connect and I get the following log:

2014-01-16 11:10:27.556 DM1[141:60b] Could not search: {
    NSNetServicesErrorCode = "-72000";
    NSNetServicesErrorDomain = 10;
}
2014-01-16 11:10:27.558 DM1[141:60b] Could not publish service: {
    NSNetServicesErrorCode = "-72000";
    NSNetServicesErrorDomain = 10;
}

(None of my IAA related methods are called in my app.)

Then the "InterAppAudioHost" quits and its log says :

2014-01-16 11:10:47.555 IAA Host[150:60b] 11:10:47.554 ERROR:     [0x3b2e718c] 168: Timed out waiting for app to launch
2014-01-16 11:10:47.557 IAA Host[150:60b] 11:10:47.557 ERROR:     [0x3b2e718c] >audiocomp> 59: null from factory proc
2014-01-16 11:10:47.559 IAA Host[150:60b] error -1 from AUGraphAddNode (hostGraph, &desc, &instrumentNode)

I have carefully checked my plist and it goes like:

<plist version="1.0">
<dict>
    <key>AudioComponents</key>
    <array>
        <dict>
            <key>type</key>
            <string>aurg</string>
            <key>subtype</key>
            <string>fld1</string>
            <key>manufacturer</key>
            <string>fglb</string>
            <key>name</key>
            <string>appName<string>
            <key>version</key>
            <integer>1</integer>
        </dict>
        <dict>
            <key>type</key>
            <string>auri</string>
            <key>subtype</key>
            <string>fld1</string>
            <key>manufacturer</key>
            <string>fglb</string>
            <key>name</key>
            <string>appName</string>
            <key>version</key>
            <integer>1</integer>
        </dict>
    </array>

...

My publishing method:

- (void) publishOutputAudioUnit {
    OSStatus result;
    const UInt32 version = 1;
    //-----------------------
    //    Publish as Remote Generator
    //-----------------------
    AudioComponentDescription IAAGeneratorDesc = { kAudioUnitType_RemoteGenerator,'fld1','fglb',0,0 };
    result = AudioOutputUnitPublish(&IAAGeneratorDesc, CFSTR("CompanyName : AppName"),version, auRemoteIO);
    if (result != noErr)
        NSLog(@"AudioOutputUnitPublish generator result: %d", (int)result);
    //-----------------------
    //    Publish as Remote Instrument
    //-----------------------
    AudioComponentDescription IAARemoteDesc = { kAudioUnitType_RemoteInstrument,'fld1','fglb',0,0 };
    result = AudioOutputUnitPublish(&IAARemoteDesc, CFSTR("CompanyName : AppName"),version,auRemoteIO);
    if (result != noErr)
         NSLog(@"AudioOutputUnitPublish instrument result: %d", (int)result);
}

It looks like there are some URL issues between the Host and the Node but I just can't figure it out.

Any help will be very, very, very welcome as I am really stuck. Many thanks.

André

like image 599
André Avatar asked Jan 16 '14 20:01

André


1 Answers

And my current plist:

<plist version="1.0">
<dict>
    <key>AudioComponents</key>
    <array>
        <dict>
            <key>manufacturer</key>
            <string>fglb</string>
            <key>name</key>
            <string>DM1 - The Drum Machine</string>
            <key>subtype</key>
            <string>dm1a</string>
            <key>type</key>
            <string>auri</string>
            <key>version</key>
            <integer>1</integer>
        </dict>
    </array>
    <key>CFBundleDevelopmentRegion</key>
    <string>English</string>
    <key>CFBundleDisplayName</key>
    <string>DM1</string>
    <key>CFBundleDocumentTypes</key>
    <array>
        <dict>
            <key>CFBundleTypeName</key>
            <string>DM1 File</string>
            <key>LSHandlerRank</key>
            <string>Owner</string>
            <key>LSItemContentTypes</key>
            <array>
                <string>net.fingerlab.beat.file</string>
            </array>
            <key>LSTypeIsPackage</key>
            <false/>
        </dict>
    </array>
like image 78
André Avatar answered Nov 15 '22 20:11

André