Re: AudioDeviceRead failure
Re: AudioDeviceRead failure
- Subject: Re: AudioDeviceRead failure
- From: Jeff Moore <email@hidden>
- Date: Tue, 12 Aug 2008 16:02:29 -0700
On Aug 12, 2008, at 3:37 PM, John Huan wrote:
Hi, Everyone,
I am trying to write a HAL Hardware Plug-In based on
SampleHardwarePlugIn code. I need to tap on the default sound output
and record any sample sent to the device.
The plugin can compile and load properly when any process uses HAL
starts up.
One thing to be aware of: SampleHardwarePlugIn does not do anything
across processes. In other words, if Process A is sending data out of
the SampleHardwarePlugIn's device, Process B won't see any of that
data on the input.
SampleHardwarePlugIn is just there to show how the APIs work. All the
heavy lifting, like moving the audio across processes or talking to
actual audio hardware, is left as an exercise for the reader.
But, the problem is, when I try to read the sample out of
the device using AudioDeviceRead, it always returns false.
According to the suggestions came from Jeff's answer on the other
mailing list item, I added a function call to register the buffer list
at first, like this:
AudioDeviceSetProperty(inDevice, NULL, 0, inIsInput,
kAudioDevicePropertyRegisterBufferList, sizeof(bufferList),
&bufferList);
But, it also returned failure with error code
kAudioHardwareUnknownPropertyError.
Does that means the default built-in output device doesn't support
direct sample reading?
AudioDeviceRead and it's supporting properties, like
kAudioDevicePropertyRegisterBufferList, only work for devices that
have input streams. Our recent Intel offerings have the audio devices
split apart by section. So the more likely answer is that you are
trying to register a buffer with a device that doesn't have any input
streams.
Is there another way to do that?
For the record, AudioDeviceRead was officially deprecated in 10.5, but
has been unofficially deprecated since the aggregate device support
came online back in 10.3. This construct was originally there to deal
with the case where an app wanted to slave the reading of the input of
one device to the IOProc of another device. This is something that is
much easier to do with an aggregate device and produces better results
to boot.
--
Jeff Moore
Core Audio
Apple
_______________________________________________
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