Skip to content

Instantly share code, notes, and snippets.

@tkemp
Created December 6, 2012 17:08
Show Gist options
  • Save tkemp/4226150 to your computer and use it in GitHub Desktop.
Save tkemp/4226150 to your computer and use it in GitHub Desktop.
Print an AudioStreamBasicDescription for a given AUGraph node
-(void) printASBDforNode:(AUNode) node scope:(int) scope bus:(int) bus {
AudioStreamBasicDescription testASBD;
UInt32 asbdSize = sizeof (AudioStreamBasicDescription);
AudioUnit nodeUnit;
AUGraphNodeInfo(_graph, node, NULL, &nodeUnit);
AudioUnitGetProperty(nodeUnit,
kAudioUnitProperty_StreamFormat,
scope,
bus, // bus
&testASBD,
&asbdSize);
NSLog (@"Node: %ld bus %d scope %d. rate: %f, %ld channels, %ld bits per channel", node, bus, scope, testASBD.mSampleRate, testASBD.mChannelsPerFrame, testASBD.mBitsPerChannel);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment