Getting BufferLists
Getting BufferLists
- Subject: Getting BufferLists
- From: Craig Bakalian <email@hidden>
- Date: Tue, 3 Feb 2004 18:18:44 -0500
Hi,
I am back at trying to save BufferList from a microphone input. I got
the microphone working okay, yet I do not know where to put the
AudioUnitRenderCallback...
Here's what I got so far->
-(void)buildGraph
{
ComponentResult result;
NewAUGraph(&mainGraph);
AUGraphOpen(mainGraph);
UInt32 size;
size = sizeof(AudioDeviceID);
AudioHardwareGetProperty(kAudioHardwarePropertyDefaultInputDevice,
&size, &deviceID);
ComponentDescription mic;
mic.componentType = kAudioUnitType_Output;
mic.componentSubType = kAudioUnitSubType_HALOutput;
mic.componentManufacturer = kAudioUnitManufacturer_Apple;
mic.componentFlags = 0;
mic.componentFlagsMask = 0;
AUGraphNewNode(mainGraph, &mic, 0, NULL, &micNode);
AUGraphGetNodeInfo(mainGraph, micNode, NULL, NULL,NULL, &micUnit);
UInt32 enableIO = 1;
result = AudioUnitSetProperty(micUnit,
kAudioOutputUnitProperty_EnableIO, kAudioUnitScope_Input, 1, &enableIO,
sizeof(UInt32));
result = AudioUnitSetProperty(micUnit,
kAudioOutputUnitProperty_EnableIO, kAudioUnitScope_Output, 0,
&enableIO, sizeof(UInt32));
result = AudioUnitSetProperty(micUnit,
kAudioOutputUnitProperty_CurrentDevice, kAudioUnitScope_Global, 0,
&deviceID, sizeof(UInt32));
UInt32 hasIO=0;
UInt32 dataSize = sizeof(UInt32);
result = AudioUnitGetProperty(micUnit, kAudioOutputUnitProperty_HasIO,
kAudioUnitScope_Input, 1, &hasIO, &dataSize );
NSLog(@"%d", hasIO);
ComponentDescription reverb;
reverb.componentFlags = 0;
reverb.componentFlagsMask = 0;
reverb.componentType = kAudioUnitType_Effect;
reverb.componentSubType = kAudioUnitSubType_MatrixReverb;
reverb.componentManufacturer = kAudioUnitManufacturer_Apple;
AUGraphNewNode(mainGraph, &reverb, 0, NULL, &reverbNode);
OSStatus err;
err = AUGraphConnectNodeInput(mainGraph, micNode, 1, reverbNode, 0);
err = AUGraphConnectNodeInput(mainGraph, reverbNode, 0, micNode, 0);
err = AUGraphInitialize(mainGraph);
err = AUGraphStart(mainGraph);
}
I want to get the BufferLists out of the micNode. Yet, could I put a
RenderCallback on the reverbNode and from there get the BufferList
coming into it from the micNode? If so, any code would be appreciated.
Ya know, I think I know how to do this if the component is a
AUNTComponent, yet I don't have a clue about AUComponents.
Craig Bakalian
www.eThinkingCap.com
_______________________________________________
coreaudio-api mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/coreaudio-api
Do not post admin requests to the list. They will be ignored.