Re: Reading the sample buffer of the default audio output
Re: Reading the sample buffer of the default audio output
- Subject: Re: Reading the sample buffer of the default audio output
- From: Jeff Moore <email@hidden>
- Date: Thu, 21 Mar 2002 11:25:22 -0800
on 3/21/02 6:55 AM, Nils Svangerd <email@hidden> wrote:
>
While browsing the CoreAudio documentation I got the impression that the
>
Audio Driver fed back the Sample buffer to the HAL, and that I could
>
read this buffer with AudioDeviceRead(). (At least while looking at
>
figure 2-3 "Writing Audio Drivers" document.) What I'm trying to do is
>
write an application that does not play any sound but process the sound
>
other applications emit through sample buffer of the Default output
>
device.
>
>
However, after initializing and starting the device and registering the
>
AudioBuffers, AudioDeviceRead() returns
>
kAudioHardwareIllegalOperationError all the time. I've only heard
>
rumours that this should be possible, but perhaps it's not? Anyone got
>
any idea how I could do this?
First off, you can't read the output buffers of other processes, or even
that of your own process. The system is designed in such a way that this
isn't exactly easy to do. Not to mention the DRM issues it entails.
Second, AudioDeviceRead() is there to allow a client that wishes to manage
their own IO thread a means to read from the input buffer of a given device.
The error you received is likely due to one of two things. Either you hadn't
started the device (with AudioDeviceStart) or you hadn't registered the
buffers you wish to use with the HAL (with
kAudioDevicePropertyRegisterBufferList).
Hope this helps.
--
Jeff Moore
Core Audio
Apple
_______________________________________________
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.