Re: Audio Unit with Java?
Re: Audio Unit with Java?
- Subject: Re: Audio Unit with Java?
- From: William Stewart <email@hidden>
- Date: Mon, 18 Jul 2005 19:09:48 -0700
On 18/07/2005, at 6:39 PM, Brian Davies wrote:
Bill Stewart posted the following in 2002:
--------------
You can use AudioUnits with Java. We haven't made any comments about
creating an audio unti with Java. It would be possible, but I'd
have to be
seriously concerned about the wisdom of doing this. If you have to
do signal
processing in Java, then you're best to hook up your result with a
render
callback to an existing audio unit, and do your DSP there. (You can
also
call the AudioUnitRender of an upstream audio unit from here if you
need to
obtain audio data from another unit in order to do your processing).
If you wanted to you could take the AudioUnit base classes in the
SDK, and
write an audio unit base class that instantiates a Java VM, calls
into some
Java Interface to do the work, etc... Kind of like the way the
effect class
extends the AUBase class... Then in C you can handle the basic AU
stuff, and
just call out to java when you need to (and in the process provide
a nice
java like API)
Bill
---------------
I want to answer his question and ask again how to use Java. I
have a sophisticated click-removal program written and stable in
Java, and I want to re-use the several thousand lines of
computational code in an Audio Unit. Translating to C++ is not
rocket science, but it would be better to keep a common code base.
And Java is supposed to be a first-rate citizen on Mac OS X.
Sure - but running Java code on a realtime audio thread can run into
problems - most notably gc issues (or hot-spot, etc). The Java
provided (and this is true on windows/linux/etc for the standard Java
VM) is NOT the RT friendly version. You also have the not
inconsiderable cost of transitioning from a C stack frame to a Java
stack frame.
Now, if this processing is basically an offline processing module,
and isn't expected to run in realtime, then you could certainly deal
with this just fine as an auol type (Offline AU)
The main problem of course is that an AU is expected to be able to be
used in low-latency situations; but if this isn't a target you expect
your users to want or need, then this may make the idea feasible.
As I said above, this is certainly something that you can do; we have
no intention of providing SDK support for this (as discussed
above).We've been clear about this for many years, at least since
2002 :-) Some AU developers are writing Objective C AUs as well, but
we don't have Obj-C implementations of our SDK (for similar reasons)
but this hasn't stopped people from doing this themselves.
Apple state "Because the Java API so closely follows the C API, ...
the language choice is up to you, depending upon your development
needs and requirements". But my attempts to extend the Java
CoreAudio class are thwarted by the fact that the constructors are
private.
Well, two comments about this:
(1) This is from the perspective of the API - USING the CoreAudio API
is different matter than implementing it. I can use the Core Audio
API from any language I wanted to, even a character parsed scripting
language with hundreds of instructions to dispatch. This is because
we have take a considerable care to allow you to be a consumer of the
API without affecting its ability to behave itself. So, lets stay on
topic here please.
(2) This is deprecated from our point of view in any case. The entire
source for the bridging to the CA API from Java is in the SDK and has
been for nearly two years now. The reason that this is there is so
you can use it as a basis to do what you need to do to move forward.
Lets also get some perspective here. Java is a cross-platform
runtime. The reason we deprecated CAJava is that no-one was using it.
The reason no-one was using it; it didn't work cross-platform. In
fact, as little as a week ago, someone asking about using MIDI from
CAJava was "strongly advised" from another user on this list to not
waste his time working on a Mac OS X specific API because it wouldn't
work elsewhere, and instead it was suggested that he use a more
broadly supported java midi extension.
Final comment - if I am forced to use C++
Brian, who is forcing you into this? You start this conversation as
though we are holding your legs to the fire here, but I really don't
see this. You do what you think is best.
Bill
then the Steinberg VST framework is an obvious competitor. And it
will be OK on Windows too. Surely that's not what apple really want
to push??
Brian Davies
Mathematical Sciences Institute
Australian National University
Canberra ACT 0200
Australia
tel: (02)6125-2915
http://www.maths.anu.edu.au/~briand/sound
_______________________________________________
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
--
mailto:email@hidden
tel: +1 408 974 4056
________________________________________________________________________
__
"Much human ingenuity has gone into finding the ultimate Before.
The current state of knowledge can be summarized thus:
In the beginning, there was nothing, which exploded" - Terry Pratchett
________________________________________________________________________
__
_______________________________________________
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