Re: In need of documentation 2
Re: In need of documentation 2
- Subject: Re: In need of documentation 2
- From: "Michael C. Thornburgh" <email@hidden>
- Date: Wed, 23 Jan 2002 18:20:41 -0800 (PST)
Rolley:
i apologize for the lack-of-timeliness of my response,
but i just joined this list yesterday and am catching up
on the last month-or-so's postings.
by the time i got to it, Lieven's example was no longer
at the URL given.
for my own projects, i wrote a reasonably complete Cocoa-
flavored Obj-C wrapper around the CoreAudio HAL routines
that you (and maybe other folks here) might find useful.
the "AudioMonitor.app" example, in fact, does the "play
any input to any output" function for you (with some
limitations). it's at
http://aldebaran.armory.com/~zenomt/macosx/
and has the library and two examples with full source and
documentation.
-mike
>
From: Rolley <email@hidden>
>
Subject: Re: In need of documentation 2
>
Date: Wed, 16 Jan 2002 22:25:29 -0500
>
>
Thanks !
>
>
ok, I took a look at the source code for PlayThru :
>
>
What I understand (please tell me if i am wrong or missed anything) all
>
you need is :
>
catch get the data written the input and pass it to the ouput.
>
>
To do this you need to define the input and output :
>
AudioHardwareGetProperty(...); which gives you a pointer to both of
>
them.
>
>
then there are two methods that (I guess) the OS calls :
>
- InputIOProc
>
Where you get the data written to the input buffer and put it in
>
your own Queue.
>
- OutputIOProc
>
Where you "BlitThisData". Here you "send" the data which is in
>
your own Queue.
>
This seems to be the "big deal" of this program : (here I need
>
explications)
>
i.e. you process the data found in your queue to be playable and
>
send it to the output.
>
But I don't understand AT ALL what is being done in this function.
>
>
>
So I could write this in C, C++, or Java, all I need is a data structure
>
to keep the inputs, and then send them to the ouput. This being done with
>
the three functions above
>
Ok, this starts to make sense (I hope). Are there any other needed
>
operations I should know of ?
>
And please could you clarify what BlitThisData() does, expecially since
>
(French being my usual language) I have no idea what Blit means ! 8)
>
>
Thanks again,
>
Rolley
>
>
On Wednesday, January 16, 2002, at 07:06 PM, Lieven Dekeyser wrote:
>
>
>> Hi,
>
>>
>
>> I'd like to write an audio application that would just play in real-rime
>
>> what's coming through an input port. For exemple, I have a G4 with a
>
>> standard input and I would like to be able to plug-in an instrument
>
>> (guitar, mic...), start that application and "voila" my computer is my
>
>> amplifier (sound is processed by computer). I know this already exists
>
>> (TCWorks' SPARKme) but I would just like to get some experience with the
>
>> audio system of OSX.
>
>
>
> I've put some sample code how to do this on my website:
>
> http://studwww.rug.ac.be/~lbdkeyse/source/CoreAudio/
>
>
>
>> I went through apple's web site and, yes, there is are some pdfs
>
>> (coreaudio.pdf) explaining how CoreAudio is built but I can't find any
>
>> that actually explains how to code with it.
>
>
>
> the documentation is horrible indeed (to the person(s) that actually wrote
>
> it : no offence :) )
>
>
>
> Maybe the most useful information is in the headers...
>
> Other than that, I suggest you take a look at some sample code.
>
> If you still have questions, the people on this list are very very
>
> very helpful (thanks again for all the answers!)... I just hope I didn't
>
> bother them too much with all my questions ;)
>
>
>
>> Also I don't understand where is Objective-C is required. I did a Cocoa
>
>> Project in Project-Builder with OpenGL and C++, no need for Objective-C.
>
>> Please tell me I don't need Obj-C to write audio utilities 8)
>
>
>
> /msg Rolley "you don't need Obj-C to write audio utilities" :-)
>
>
>
> but Obj-C is a great language, and together with Cocoa, Project Builder
>
> and Interface Builder, it's (in my humble opinion) one of the best ways to
>
> create flexible & maintainable applications.
>
>
>
> But as I said, you don't need Obj-C... you can use C, C++, Obj-C and
>
> even Java
>
>
>
> The sample code on my website is (as you might have guessed) in Obj-C, but
>
> you can just copy the parts you need to your C/C++ project...
>
>
>
> yo!
>
>
>
> --Lieven