Thanks for the tips.
I've written a spike, according to the link you mentioned.
I can get it to all start up OK (that is, no errors), but I'm not
getting anything for my levels. Just 'infinity'.
I (perhaps wrongly) didn't setup a channel map (hoping the default is
OK), or an input proc (as I don't want to actually DO anything with
the data).
Is an input proc required, even if I'm not wanting to save/play the
audio?
In the interest of keeping one thread only: Karim Morsy also replied
with the idea that I might be able to setup a link from AUHAL (input)
-> mixer -> AUHAL (output), but the docs say that you can only have
one output unit in a graph. I tried to create another unit using the
same component description, but got error -10862 (which I cannot see
doco for).
I've posted the code below, for reference. Hope it's not too much to
wade through. If you're looking for where I start things rolling,
it's at a method called monitorDevice.
---
Neil Clayton
//
// AudioPreview.m
// iShowU
//
// Created by Neil Clayton on 18/06/2006.
// Copyright 2006 __MyCompanyName__. All rights reserved.
//
- (void) enableIO {
UInt32 enableIO;
//When using AudioUnitSetProperty the 4th parameter in the method
//refer to an AudioUnitElement. When using an AudioOutputUnit
//the input element will be '1' and the output element will be '0'.
enableIO = 1;
AudioUnitSetProperty(inputUnit,
kAudioOutputUnitProperty_EnableIO,
kAudioUnitScope_Input,
1, // input element
&enableIO,
sizeof(enableIO));
enableIO = 0;
AudioUnitSetProperty(inputUnit,
kAudioOutputUnitProperty_EnableIO,
kAudioUnitScope_Output,
0, //output element
&enableIO,
sizeof(enableIO));
}
- (void) setVolumes {
// Not sure if I need to do this or not. It's had no effect so far,
but did within ComplexPlayThru (when I modified it to have a mixer)
// // Enable the mixer input's and output's
// OSStatus err = AudioUnitSetParameter(mixerUnit,
kMatrixMixerParam_Enable, kAudioUnitScope_Input, 0, 1, 0);
// checkErr(err);
// err = AudioUnitSetParameter(mixerUnit, kMatrixMixerParam_Enable,
kAudioUnitScope_Output, 0, 1, 0);
// checkErr(err);
//
// // Set global volume
// err = AudioUnitSetParameter(mixerUnit, kMatrixMixerParam_Volume,
kAudioUnitScope_Global, 0, 1, 0);
// checkErr(err);
//
// // Set master volume
// err = AudioUnitSetParameter(mixerUnit, kMatrixMixerParam_Volume,
kAudioUnitScope_Global, 0xFFFFFFFF, 1, 0);
// checkErr(err);
//
// // Set input and output volumes
// err = AudioUnitSetParameter(mixerUnit, kMatrixMixerParam_Volume,
kAudioUnitScope_Input, 1, 1, 0);
// checkErr(err);
// err = AudioUnitSetParameter(mixerUnit, kMatrixMixerParam_Volume,
kAudioUnitScope_Output, 0, 1, 0);
// checkErr(err);
}
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/coreaudio-api/email@hidden