• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: How to set my AUDynamicsProcessor's audioformat?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to set my AUDynamicsProcessor's audioformat?


  • Subject: Re: How to set my AUDynamicsProcessor's audioformat?
  • From: Chris Adamson <email@hidden>
  • Date: Mon, 03 Dec 2012 17:12:54 -0500

My experience is that the effect units introduced in iOS 5 and later will only work with floating-point samples. Typically, I either:

1. Copy the default kAudioUnitProperty_StreamFormat (an ASBD) from the effect unit (input or output scope, either seems to be fine) and set that format on all the other connections in my AUGraph.

Or, if that's not possible (e.g., some unit can't take floating point, need to start or end with ints, etc.):

2. Create AUConverter nodes before and after any effect units in the graph to convert into and out of the floating-point format.

--Chris

On Dec 3, 2012, at 5:20 AM, Pier <email@hidden> wrote:

Ok doing this : (from Chris Adamson's code) 

    AudioStreamBasicDescription effectASBD;
UInt32 asbdSize = sizeof (effectASBD);
memset (&effectASBD, 0, sizeof (effectASBD));
AudioUnitGetProperty(_dynamicsUnit, kAudioUnitProperty_StreamFormat, kAudioUnitScope_Input, 0, &effectASBD, &asbdSize);
effectASBD.mSampleRate = 44100.0;

gives 

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

which uses more bytes than I need for my purposes. 
So the question is - in order to use Apple's AudioUnits, do I absolutely need to conform to these absd parameters? 

Thanks. 

Pier. 



On Mon, Dec 3, 2012 at 5:20 PM, Pier <email@hidden> wrote:
Hi, 

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]

Why is it that it shows 0Hz, and 32-bit little endian float for the connection between remoteio and dynamicprocessor when I did not specify it? 

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.

Thanks in advance for your help. 

--
Pier.



--
Pier.
Do not post admin requests to the list. They will be ignored. Coreaudio-api mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
  • Follow-Ups:
    • Re: How to set my AUDynamicsProcessor's audioformat?
      • From: Pier <email@hidden>
References: 
 >How to set my AUDynamicsProcessor's audioformat? (From: Pier <email@hidden>)
 >Re: How to set my AUDynamicsProcessor's audioformat? (From: Pier <email@hidden>)

  • Prev by Date: Re: How to capture audio generated by a render callback, iOS
  • Next by Date: Looking up AU parameters (was: Re: kAudioUnitSubType_DynamicsProcessor)
  • Previous by thread: Re: How to set my AUDynamicsProcessor's audioformat?
  • Next by thread: Re: How to set my AUDynamicsProcessor's audioformat?
  • Index(es):
    • Date
    • Thread