Re: Is is possible to have an AUGraph output to memory?
Re: Is is possible to have an AUGraph output to memory?
- Subject: Re: Is is possible to have an AUGraph output to memory?
- From: Dave Camp <email@hidden>
- Date: Fri, 11 May 2012 15:52:36 -0700
On May 11, 2012, at 2:09 PM, Brian Willoughby wrote:
> Dave, you're focused a CoreAudio decoder, but really there are some basic AudioUnit rules that you should learn because they affect all AudioUnits and hosts.
>
> For one, an AudioUnit never reads a file. It is the job of the AUHost application to read files. The AUGraph deals with audio sample buffers in memory exclusively, because that is what AudioUnits are designed to handle on input and output. The only exception is the AUAudioFilePlayer, which will read a file and send the audio samples to its output. In an AUHost like Logic, all file I/O is handled by the application, not the AUGraph (assuming Logic uses an AUGraph to host AudioUnits).
That is good to know. I've read through the Core Audio docs and worked my way through several of the sample projects, but I'm still coming up to speed. I have not seen anything in the docs that goes in depth on the app loading the samples in memory and feeding them to the graph, maybe I missed it. Based on the RawAudioFileComponent sample, I had assumed that audio file components were responsible for reading packets from a file, probably because I can't find any documentation at all on audio file components.
> By the way, the definition of a decoder is that it is an AudioUnit that generates LPCM, so that should answer part of your question. An encoder takes LPCM on input. Encoders and decoders are the only AudioUnits which work with non-audio data (the data-compressed version of the audio is not strictly legal, which is why it must be converted to/from LPCM). AUConverter is very similar.
>
> Your pseudocode seems to be missing the API calls that would link the output of the decoder to the input of the default output unit. Because an AUGraph can be an arbitrary tree, there's not way for these connections to happen automatically. You must explicitly patch the virtual audio cables.
Sorry, I left that out. I do have the AU call in my actual code that links them together.
I guess I'll keep working on my code, and if I can't get decoding working I'll post the actual code for review.
Thanks,
Dave
_______________________________________________
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