Re: Streaming audio to built-in audio device
Re: Streaming audio to built-in audio device
- Subject: Re: Streaming audio to built-in audio device
- From: Stephen Davis <email@hidden>
- Date: Mon, 7 May 2007 00:24:38 -0700
On May 6, 2007, at 5:58 PM, B. Mitchell Loebel wrote: Hello Andrew, Mark, and others on this list:
Please ... let's not go into PC deprecations ala "I've never met a decent C programmer who can't follow simple C++ or ObjC samples". I'm looking for a solution in C; if you can help, I'd very much appreciate ... if not, please don't waste my time and that of other readers.
Complicated coding is not my problem. Rather its Apple's many extensions to C that I don't have time or desire to learn ... I'd like to cut my usage of them to a bare minimum.
Cutting to the chase ...
The solution I'm seeking doesn't have a user interface ... my host app does that. So I'm looking for a code snippet to hard wire into my app. I'm not even looking for a plug-in because that implies dynamic loading by my app at launch time.
I did some looking in the Apple refs and came up with TN2097, DefaultOutputUnit, and the notion of an
AudioStreamBasicDescription struct. I can assign all the parameters
that are important to me into that struct ... good. I also saw a way to
set up a renderCallback method ...
- "that will be used as the input procedure when rendering data to
the AudioUnit. The input procedure will be called only when the Audio
Converter needs more data to process" (quoting TN2097)
Question .. how do I instantiate the DefaultOutputUnit without having to become a Component Manager expert ;-).
TN2097 described how I should bind a renderCallback method into the AU ... good. I see where the Audio Unit is the 'consumer' of my data ... my app is the 'producer'. Having told the Audio Unit the size and shape of my frames (my app will load a buffer with a frame for the Audio Unit to 'pull'), I'd like to pass a pointer to the AU when it needs more data to drive its D/A and speakers. I saw somewhere that the renderCallback is supposed to return a ComponentResult, but I can't find out what that looks like ... question. I do know what my renderCallback function needs do to create the pointer to my buffer ... my app does that coding.
Finally, I need to know how to start and stop the Audio Unit engine.
I think most of the questions I've raised would be answered if I could find a list of functions associated with the DefaultOutputUnit ... in C. Are you able to point me there please?
It won't answer all of your questions but take a look at the usage of the DefaultOutputUnit in the "SimpleSDK" at /Developer/Examples/CoreAudio/SimpleSDK/DefaultOutputUnit. That's about as minimal as you can get.
hth, stephen
|
_______________________________________________
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