Re: Coreaudio-api Digest, Vol 3, Issue 193
Re: Coreaudio-api Digest, Vol 3, Issue 193
- Subject: Re: Coreaudio-api Digest, Vol 3, Issue 193
- From: Christopher Ashworth <email@hidden>
- Date: Wed, 21 Jun 2006 15:58:09 -0400
Ah, looking back I see you posted this among other code an earlier
email. Sorry for missing it.
One thing to check: your earlier code sample includes the line
err = AUGraphInitialize(auGraph);
after you try to set the device and enable IO. I believe this must
be done before setting the device properties of the AUHAL unit.
I also notice that you were not setting the number of busses for the
Mixer. I'm not sure this matters, as it may be 1 by default, but in
my use of the mixer I include the following during setup (error
checks removed):
UInt32 numbuses;
numbuses = 1;
AudioUnitSetProperty( _outMixerUnit,
kAudioUnitProperty_BusCount,
kAudioUnitScope_Input,
0,
&numbuses,
sizeof(UInt32) );
numbuses = 1;
AudioUnitSetProperty( _outMixerUnit,
kAudioUnitProperty_BusCount,
kAudioUnitScope_Output,
0,
&numbuses,
sizeof(UInt32) );
On Jun 21, 2006, at 3:03 PM, email@hidden
wrote:
Part 2)
In answer to two other questions regarding setting the volume on the
mixer. Yes, I do do this. I'm using code gleaned from
MatrixMixerTest, which does:
- (void) setVolumes {
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);
As a sidenote, here's a sample function I use to set crosspoint volumes:
- (OSStatus) setCrosspointVolume: (float) volume atInput: (UInt32)
input atOutput: (UInt32) output
{
OSStatus err = noErr;
if ([self validInputChannel:input] && [self
validOutputChannel:output]) {
UInt32 element = (input << 16) | (output & 0x0000FFFF);
err = AudioUnitSetParameter( _outMixerUnit,
kMatrixMixerParam_Volume,
kAudioUnitScope_Global,
element,
volume,
0);
} else {
err = INVALID_CHANNEL;
}
return 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, 0, 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:
This email sent to email@hidden