Re: Audio Capture (Java)
Re: Audio Capture (Java)
- Subject: Re: Audio Capture (Java)
- From: Zachary Crockett <email@hidden>
- Date: Tue, 23 Jul 2002 00:03:28 -0500
>
> (I'm glad to hear someone else say the docs for CoreAudio aren't the
>
> best.. I've had a heck of a time trying to learn the API.)
>
They are lousy. Or at least bad enough that I fear that the
>
one who made the Java API made a big mistake that makes it
>
impossible to write aa clean Java app with sound input...
>
>
> After several attempts, I'm stumped -- I'm using the HAL for
>
> capture. I
>
> get the default input AudioDevice using
>
> AudioHardware.getDefaultInputDevice(), and register an
>
This is exacly the point where I gave up for the moment. A clean code
>
must get the properties of
>
AHConstants.kAudioDevicePropertyStreamConfiguration
>
and store the result in an com.apple.audio.util.AudioBufferList
>
In the time I spent I came to the conclusion that there is a
>
design bug in the Java API that I can't instantiate such an object
>
and therefore can't store the results of that call.
>
(there is a second bug: the javadocs aren't created with class-use
>
so I can't be sure about that. And there is no source code so
>
I can't create the javadocs myself)
I've been wondering about that -- why on earth are there no public
constructors for what seems like over half of the CoreAudio classes?
AudioBufferList being a HUGE one, and AudioBuffer and
AudioValueTranslation are two other biggies... how in the world is one
supposed to use these objects if she can't instantiate them? I was
assuming I just didn't understand it well enough...
or is there some hidden static method somewhere which returns an
instance of these objects? The Javadocs don't have any "See"
references, which makes finding such things incredibly difficult... for
instance, I was baffled that there was no public constructor for
com.apple.audio.units.AudioDeviceOutputUnit, but after several hours of
perusing the javadocs, I finally found the static method
com.apple.audio.units.AUComponent.getDefaultOutput() which returns an
instance.
>
> AudioDeviceIOProc... However, the inInputData parameter of the IOProc
>
> doesn't seem to actually contain anything but near-silence even if I
>
... are you sure that you know what device you are listening to?
>
Is it the same you are screaming to? Tried to insert an audio CD?
Good point, and on that note, also in response to Mike Thornburgh who
wrote:
>
if you're not getting anything other than 1-1.5 bits
>
of noise even when a microphone is connected to the
>
sound input port, then i bet your source is set to
>
"Zoomed Video".
>
>
you can change the input source by turning on speech
>
recognition and choosing from the "Microphone" pulldown
>
in the "Listening" tab. or, of course, you can set
>
it yourself in your program.
I looked in the speech preferences and the internal mic was selected,
however speakable items was off. When I turned it on, my app was able
to capture audio. So my question is: how can I "set it [my]self in [my]
program"? (i.e., wrest control of audio input from the SpeechManager)
Is this set using kAudioDevicePropertyDataSource? If so, how do I deal
with getting the NameForID property since the IDs mean nothing to me & I
can't instantiate an AudioValueTranslation?
Thanks much... (and does anyone know if Apple plans ever to
implement/support the Java Sound API?)
Zac
:(
I've got a bad feeling this project is nearly impossible in Java on my
Mac
PS - if anyone can point me to sample java code which successfully
captures audio on a mac, I'd appreciate it -- last I looked, none of
apple's posted java code has anything to do with capture, only playback.
_______________________________________________
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.