• 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
Difference between AUGraphConnectNodeInput() and kAudioUnitProperty_MakeConnection property
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Difference between AUGraphConnectNodeInput() and kAudioUnitProperty_MakeConnection property


  • Subject: Difference between AUGraphConnectNodeInput() and kAudioUnitProperty_MakeConnection property
  • From: Chris Adamson <email@hidden>
  • Date: Tue, 30 Mar 2010 08:54:10 -0400

I'm writing some iPhone sample code, and started with a simple pass through of the input to the output.  I usually do this with an AUGraph, and my code for that works as expected:

<http://pastie.org/895098>

(BTW, take it as given that I've set up the audio session for the play-and-record category and retrieved the hardwareSampleRate, though it also works to just hard code 44100).

Since I want to insert my own DSP into the arrangement, and can't write a custom unit, I decided to use the kAudioUnitProperty_MakeConnection property to connect bus 1's output scope to bus 0's input scope, effectively replacing

setupErr = AUGraphConnectNodeInput(auGraph, remoteIONode, 1, remoteIONode, 0);

with 

AudioUnitConnection connection;
connection.sourceAudioUnit = remoteIOUnit;
connection.sourceOutputNumber = bus1;
connection.destInputNumber = bus0;


setupErr = 
AudioUnitSetProperty(remoteIOUnit, 
 kAudioUnitProperty_MakeConnection,
 kAudioUnitScope_Input,
 bus0,
 &connection,
 sizeof (connection));

Full listing of this setup method at:

<http://pastie.org/895103>

When I do it this way, I get a weird effect on the audio, which I've captured here:

<http://www.subfurther.com/buglets/au-make-connection.m4a>

Thinking it was an SInt16 vs. 8.24-fixed-point issue, I changed my ASBD to kAudioFormatFlagsAudioUnitCanonical, but that didn't make a difference.  I considered putting a converter unit in the middle, but it seems like I've already set bus 1 output and bus 0 input to the same ASBD, so it's not clear what would need to convert to what.

I also got the same effect by making the connection with a render proc that simply calls AudioUnitRender() on the I/O unit's bus 1.

Long story short: it seems like AUGraphConnectNodeInput() and setting the kAudioUnitProperty_MakeConnection ought to do the same thing, but don't. So what's the difference?  And what else would I need to do in the second case to do a straight mic-to-headphone pass-through?

Thanks!

--Chris

 _______________________________________________
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: Difference between AUGraphConnectNodeInput() and kAudioUnitProperty_MakeConnection property
      • From: William Stewart <email@hidden>
  • Prev by Date: getting data for SPL measurments
  • Next by Date: Re: Difference between AUGraphConnectNodeInput() and kAudioUnitProperty_MakeConnection property
  • Previous by thread: getting data for SPL measurments
  • Next by thread: Re: Difference between AUGraphConnectNodeInput() and kAudioUnitProperty_MakeConnection property
  • Index(es):
    • Date
    • Thread