Re: Channel Maps and HALOutputUnit
Re: Channel Maps and HALOutputUnit
- Subject: Re: Channel Maps and HALOutputUnit
- From: James Coker <email@hidden>
- Date: Wed, 11 Feb 2004 12:17:04 -0700
You have to set the property first based on the number of channels. I
use
the StreamFormat to get the number of channels, seems to work fine:
// get stream format for output buss
size = sizeof(streamDesc);
osStatus = AudioUnitGetProperty(_halOutputUnit,
kAudioUnitProperty_StreamFormat,
kAudioUnitScope_Output,
0,
&streamDesc,
&size );
_numOutputs = (unsigned int)streamDesc.mChannelsPerFrame;
printf("### hal out num output channels for stream 1: %u status:
%d\n",
(unsigned int)_numOutputs, (int)osStatus);
// Setup Channel Map
printf("setup ch map: %d channels\n", (int)_numOutputs);
_outputChannelMap = malloc(sizeof(SInt32) * _numOutputs);
for(j = 0; j < _numOutputs; j++) {
_outputChannelMap[j] = j;
}
printf("..sizeof map: %u\n", (unsigned int)sizeof(_outputChannelMap));
osStatus = AudioUnitSetProperty(_halOutputUnit,
kAudioOutputUnitProperty_ChannelMap,
kAudioUnitScope_Global,
0,
_outputChannelMap,
(sizeof(SInt32) * _numOutputs));
On Feb 11, 2004, at 11:32 AM, Robert Grant wrote:
I'm probably doing something wrong but trying to get info on
kAudioOutputUnitProperty_ChannelMap returns the
kAudioUnitErr_PropertyNotInUse error.
I thought all HALOutputUnits had this property set?
Thanks for any insight,
Robert.
_______________________________________________
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.
_______________________________________________
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.