'audiobusSenderPort' is deprecated: use ABSenderPort's audio unit initializer instead
Hi,
I'm having this warning on my app:
'audiobusSenderPort' is deprecated: use ABSenderPort's audio unit initializer instead
The app is producing sound while not connected to AudioBus but as soon as I connect it to Audiobus, the audio stops.
Might this be the problem?
I'm using Audiobus 2.31 and TAAE 1.5.5
This is my init function:
-(id)init
{
self = [super init];
if (self)
{
NSError *error = NULL;
_linkRef = ABLLinkNew(120, 4);
_linkSettings = [ABLLinkSettingsViewController instance:_linkRef];
_linkSettingsOpen = false;
ABLLinkSetSessionTempoCallback(_linkRef, onSessionTempoChanged, [[UIApplication sharedApplication] keyWindow].rootViewController);
self.audioController = [[AEAudioController alloc] initWithAudioDescription:[AEAudioController nonInterleaved16BitStereoAudioDescription] inputEnabled:NO];
self.audioController.allowMixingWithOtherApps = YES;
self.audioController.preferredBufferDuration = 0.007f;
BOOL result = [_audioController start:&error];
if (!result)
{
NSLog(@"There was an error while starting AE");
}
else
{
NSLog(@"AE Started");
}
}
return self;
}
And this is my start audio function:
-(void)initializeAudio(int sampleRate, int bufferSize)
{
Q_UNUSED(bufferSize)
DRCAppDelegate *app = [DRCAppDelegate sharedDRCAppDelegate];
app.channel = [AEBlockChannel channelWithBlock:^(const AudioTimeStamp *time, UInt32 frames, AudioBufferList *audio)
{
Q_UNUSED(time)
float *outL = (float*)audio->mBuffers[0].mData;
float *outR = (float*)audio->mBuffers[1].mData;
static float phi=0;
while(frames--)
{
phi += (2.f * M_PI * 440 * (1.f/44100.f));
float v = qSin(phi);
*outL++ = v;
*outR++ = v;
}
}];
app.channel.audioDescription = [AEAudioController nonInterleavedFloatStereoAudioDescription];
app.channel.channelIsMuted = NO;
app.channel.volume = 1 ;
[app.audioController addChannels:@[app.channel]];
app.audiobusController = [[ABAudiobusController alloc] initWithApiKey:@"APIKEY"];
app.audiobusController.connectionPanelPosition = ABConnectionPanelPositionLeft;
AudioComponentDescription componentDescription = (AudioComponentDescription)
{
.componentType = kAudioUnitType_RemoteInstrument,
.componentSubType = 'xpto',
.componentManufacturer = 'xpto'
};
ABSenderPort *sender = [[ABSenderPort alloc] initWithName:@"PORT" title:NSLocalizedString(@"PORT", @"") audioComponentDescription:componentDescription];
[app.audiobusController addSenderPort:sender];
app.audioController.audiobusSenderPort = sender; // THIS IS WHERE THE WARNING HAPPENS
[app.audiobusController addObserver:app forKeyPath:@"connected" options:0 context:kAudiobusConnectedOrActiveMemberChanged];
[app.audiobusController addObserver:app forKeyPath:@"memberOfActiveAudiobusSession" options:0 context:kAudiobusConnectedOrActiveMemberChanged];
}
Thanks in advance,
Regards,
Nuno