• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Audio Capture (Java)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Audio Capture (Java)


  • Subject: Re: Audio Capture (Java)
  • From: Bill Stewart <email@hidden>
  • Date: Wed, 31 Jul 2002 14:46:45 -0700

on 7/31/02 1:37 PM, Gerd Castan wrote:
>> You get these objects instantiated for you by the core audio API. You can't
>> copy an object that you create into the ones given you by the API calls, so
>> there's no need for a public constructor.
> Please give use at least two lines of code.
>
> the second line is probably (according to the spec) something like
>
> inputDevice.getInputProperty (AHConstants.kAudioPropertyWildcardChannel,
> AHConstants.kAudioDevicePropertyStreamConfiguration,audioBufferList);
>
> Since Java doesn't allow to instantiate audioBufferList inside
> getInputProperty using this syntax, I need to get an instance of
> audioBufferList before I do this. Which is the recommended way
> of getting this instance?

You can pass in a CAMemoryObject for this call - then use the getIntAt (etc)
calls to look into the values of the buffer list that this call returns -
you pass in the byte offset into the getIntAt call of where you expect that
value to be as it corresponds to the native format (Its a workaround...)

>> In fact, there is a considerable efficiency gained by doing things this way
>> that would be lost if you were to create these objects yourself (aside from
>> the fact that the underlying API doesn't support the replacement semantic
>> anyway)
>>
>> The same is applied to the I/O objects in the CoreMIDI API...
>>
>>
>>> 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.
>>
>>
>> This is due to the way that components work. Basically, you find the
>> component that describes the audio unit you want, then you create an
>> instance of that through the open call...
>>
>> There are examples in the /Developer/Examples/CoreAudio directory that shows
>> you how to use these.
>>
>> There are design patterns being used here that is based on the usage of
>> these objects and how the system represents these. Using a constructor is
>> not the only design pattern that can be applied.
> You need to create javadocs with class-use for all other design
> patterns, which hasn't been the case when the thread started.
>
> The spec says a clean application has to use
> kAudioDevicePropertyStreamConfiguration. None of the mentioned examples
> does it this way.
>
> And I didn't find a way to do it.

I'd missed this - Michael may have some comments about this as well

Bill

--
mailto:email@hidden
tel: +1 408 974 4056

__________________________________________________________________________
"...Been havin' some trouble lately in the sausage business," C.M.O.T.
Dibbler replied.
"What, having trouble making both ends meat?"
__________________________________________________________________________
_______________________________________________
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.

References: 
 >Re: Audio Capture (Java) (From: Gerd Castan <email@hidden>)

  • Prev by Date: Re: Audio Capture (Java)
  • Next by Date: Developing a PCI Audio Driver
  • Previous by thread: Re: Audio Capture (Java)
  • Next by thread: Setting sample rate
  • Index(es):
    • Date
    • Thread