Re: HALOutputUnit (Pt 2)
Re: HALOutputUnit (Pt 2)
- Subject: Re: HALOutputUnit (Pt 2)
- From: Aaron Eppolito <email@hidden>
- Date: Tue, 24 Feb 2004 18:01:40 -0800
On Feb 24, 2004, at 3:16 PM, Bob Stuller wrote:
>
Ouch! Reviewing the situation (all references are to the input bus,
>
element #1):
>
1) The input (device) scope is a read-only property for format in
>
general and sample rate in particular.
I don't know if the input scope of the input bus is read only, but the
device properties can be set with
AudioDeviceSetProperty(...kAudioDevicePropertyNominalSampleRate...)
>
2) The input & output ends of the bus must match on sample rates &
>
number of channels.
They must match on sample rate, and the number of channels out of the
HALAU must be <= the number into it.
>
3) I'm always going to find the output end's sample rate to be 44.1kHz.
It always starts out that way; that's why you need to set its output
scope to be equal to its input scope.
>
Therefore, I can _only_ get 44.1kHz out of the HALAU.
No. You can only get out what it gets in. Since #1 is flawed, this
whole reasoning is flawed. Also, even if your device only did 44.1,
you could always put an AUConverter into the graph and have it convert
to whatever sample rate you want (I think; I've not tried it...)
>
So I simply cannot do what I feel I need to do using the HALAU.
>
Bummer!
Not true. This should work. Simply: ("simply" in quotes)
* Set the device sample rate with
AudioDeviceSetProperty(...kAudioDevicePropertyNominalSampleRate...)
* Get the input bus' input scope's ASBD
* Get (or create) the input bus' output scope's ASBD
* Set the sample rate to be equal to the input rate
* Set the input bus' output scope's ASBD to be the one you just
created/modified
FYI: It seems I use bus interchangeably with element. I'm not sure
which is the right term...
On Feb 24, 2004, at 5:38 PM, Doug Wyatt wrote:
>
Aaron -- that is true in general, but not for the output(/input) unit,
>
which fetches the format from the hardware. I see the line of code
>
that should be doing it ...
>
>
(I should also pick a nit and clarify -- all units *default* to 44.1,
>
but in most if not all, the stream format can be changed before
>
initialization -- except on the converter and I/O units, which allow
>
the format to be changed after initialization)
Uh, that's what I thought too, but unless I init the output scope of
the input bus, it insists on being 44.1kHz, and Bill said that that was
to be expected. The *input* scope of the input bus gets init'ed, but
seemingly not the *output* scope of the input bus.
Oh, and by the way, I'm not a CA engineer, so take anything I say with
a grain of salt, and anything they say as gospel... =)
-Aaron
_______________________________________________
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.