iOS - AudioFormat issue linking up mixer, remoteio and dynamics processor

1

I'm trying to link up my mixer -> remoteio -> dynamics processor

Here is my AudioFormat // Describe format

memset( &audioFormat, 0, sizeof(AudioStreamBasicDescription) );
audioFormat.mSampleRate         = 44100.00;
audioFormat.mFormatID           = kAudioFormatLinearPCM;
audioFormat.mFormatFlags        = kAudioFormatFlagIsSignedInteger | kAudioFormatFlagIsPacked;
audioFormat.mFramesPerPacket    = 1;
audioFormat.mChannelsPerFrame   = 1;
audioFormat.mBitsPerChannel     = 16;
audioFormat.mBytesPerPacket     = 2;
audioFormat.mBytesPerFrame      = 2;

When I use CAShow it gives me the following.

AudioUnitGraph 0x4725000:
  Member Nodes:
node 1: 'auou' 'rioc' 'appl', instance 0x1c5ab3a0 O I
node 2: 'aumx' 'mcmx' 'appl', instance 0x1d07a6d0 O I
node 3: 'aufx' 'dcmp' 'appl', instance 0x1d085330 O I
 Connections:
    node   2 bus   0 => node   1 bus   0  [ 2 ch,  44100 Hz, 'lpcm' (0x00000C2C) 8.24-bit little-endian signed integer, deinterleaved]
node   1 bus   0 => node   3 bus   0  [ 2 ch,      0 Hz, 'lpcm' (0x00000029) 32-bit little-endian float, deinterleaved]

Trying result = AudioUnitSetProperty ( _dynamicsUnit, kAudioUnitProperty_StreamFormat, kAudioUnitScope_Input, 0, &audioFormat, sizeof (audioFormat) );

to set the audioFormat to the desired format gives me a error code -10868.

I also realised that getting the ASBD from the audynamicsprocessor yields this.

effectASBD  AudioStreamBasicDescription 
mSampleRate Float64 44100
mFormatID   UInt32  1819304813
mFormatFlags    UInt32  41
mBytesPerPacket UInt32  4
mFramesPerPacket    UInt32  1
mBytesPerFrame  UInt32  4
mChannelsPerFrame   UInt32  2
mBitsPerChannel UInt32  32
mReserved           UInt32  0

and I tried various things like letting the audioformat ABSD be as per the AUdynamicsprocessor but I get the same error.

I would like to use my original audioformat ASBD as far as possible due to latency considerations. Also, my callback algorithms are already written for that audioformat. Is this possible?

Thanks in advance.

Pier.

ios
audio
core-audio
asked on Stack Overflow Dec 3, 2012 by lppier

1 Answer

1

since there's no answer I'll answer this myself for completeness. Eventually, after some advice from Chris Adamson from the Core Audio Mailing List, I did this.

I found that the dynamicsProcessor required 8.24 format. So I placed a converter before and after dynamicsProcessor to convert from my desired format to 8.24 (which dynamicsProcessor wants) and vice-versa.

mixer -> converter -> dynamicsProcessor -> converter -> remoteIO

answered on Stack Overflow Dec 5, 2012 by lppier • edited May 12, 2013 by lppier

User contributions licensed under CC BY-SA 3.0