AEAudioUnitFilters for downsampling?

First post here, but have used TAAE 1 for a while (1.5.6). Recently I've been running into an issue when attempting to add an AudioUnit downsampler as an InputFilter (44.1kHz to 16kHz). In particular, this seems to cause mismatches between the AudioStreamBasicDescription and the actual packets rendered. The downstream audio does not seem to be downsampled and message like the following appear in the logs:

AEAudioUnitFilter.m:312: AudioUnitRender: 'insz' (1768846202)
AEAudioUnitFilter.m:312: AudioUnitRender: 'insz' (1768846202)

The relevant code is (apologies for the length):

AudioComponentDescription component = AEAudioComponentDescriptionMake(kAudioUnitManufacturer_Apple,
kAudioUnitType_FormatConverter, kAudioUnitSubType_AUConverter);
decimateFilter = [[AEAudioUnitFilter alloc] initWithComponentDescription:component preInitializeBlock:
^(AudioUnit audioUnit){
AudioStreamBasicDescription format;
UInt32 format_size = sizeof(format);
AudioUnitGetProperty (audioUnit,
kAudioUnitProperty_StreamFormat,
kAudioUnitScope_Global,
0,
&format,
&format_size);
[self printASBD: format];
format.mSampleRate = lower_sample_rate_float;
[self printASBD: format];
AudioUnitSetProperty(audioUnit,
kAudioUnitProperty_StreamFormat,
kAudioUnitScope_Output,
0, &format,
format_size);
...
Might the errors might be connected to using the filter using a RenderCallback rather than an AudioUnit connection, which might be interfering with the AudioUnit downsampler initialization? Or perhaps something else? Has anyone seen something like this before?

Comments

  • OP again, posting for those that may find this later by Google. I ended up not being able to resolve this and manually wrote out the downsampling function (crude, but only takes about 30 minutes). Hopefully TAAE 2 ends up handling resampling more easily.

Sign In or Register to comment.