Re: HALOutputUnit (Pt 1)
Re: HALOutputUnit (Pt 1)
- Subject: Re: HALOutputUnit (Pt 1)
- From: James Coker <email@hidden>
- Date: Fri, 16 Jan 2004 12:17:27 -0700
To set the output device, you do set the CurrentDevice
property, like this:
_halOutputUnit = your HAL output AU
_halOutputDeviceId = the device id for the audio device
osStatus = AudioUnitSetProperty(_halOutputUnit,
kAudioOutputUnitProperty_CurrentDevice,
kAudioUnitScope_Global,
0,
&_halOutputDeviceId,
sizeof(UInt32));
I'm using the stream format to determine the number
of channels available:
AudioStreamBasicDescription streamDesc;
UInt32 size = sizeof(streamDesc);
osStatus = AudioUnitGetProperty(_halOutputUnit,
kAudioUnitProperty_StreamFormat,
kAudioUnitScope_Output,
0,
&streamDesc,
&size );
_numOutputs = (unsigned int)streamDesc.mChannelsPerFrame;
Note: There very useful utility classes in the PublicUtility
folder (in the CoreAudio examples) that are pretty much necessary
for making changes to stream formats. For an example of use,
check out the MatrixMixerTest example.
Cheers,
Jim
On Jan 16, 2004, at 7:17 AM, Craig Bakalian wrote:
Hi,
I was following this thread and learning from it. I was disappointed
when you gave up. Yet, I may find time to try this. Could you just
tell me one thing, how are you setting the device. I know how to get
an AudioDevice, yet, I don't know how to set it to the
kAudioUnitSubType_HALOutput. Do you use the AudioUnitSetProperty()
with kAudioOutputUnitProperty_CurrentDevice. If so, what does the call
look like or what are the other parameters?
Craig Bakalian
www.eThinkingCap.com
On Jan 15, 2004, at 4:03 PM, email@hidden
wrote:
Hi Jeff,
Sadly the ssh trick isn't working - the machine seems to be locked
tight (except for the mouse).
I mentioned to Brad that I'm giving up on this for now until there's
an
example project that I can study. I'm not getting a clear picture of
how it's supposed to work and I'm trashing my machine using the trial
and error approach...
Thanks for all the help so far,
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.