• 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: Input AudioUnit?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Input AudioUnit?


  • Subject: Re: Input AudioUnit?
  • From: William Stewart <email@hidden>
  • Date: Wed, 14 Jan 2004 14:33:22 -0800

Robert,

To get input you have to cal AudioUnitRender on the AUHAL unit's
busNumber == 1.

There are two situations where you can do this:
(1) You are wanting input from a device that has output... So, you are
already doing output to an AUHAL unit, the AUHAL unit calls your
upstream units (or render callbacks) for audio data, and at some point
you either have (a) a connection from the AUHAL (output element 1) to
the input of another AU, or you are in a render callback, and you turn
around and call AudioUnitRender (busNumber/ementID == 1) of the AUHAL
unit yourself

or

(2) You are wanting to read input from say a USB Device, and so you
don't have a thread that is common for both the audio input and
output... In this case you use the callback you register with the AUHAL
unit using the kAudioOutputUnitProperty_SetInputCallback property. This
then calls your callback when input data is available to be read, and
in that callback you call AudioUnitRender (busNumber/elementID == 1) on
the AUHAL unit yourself to get the input data.


In either case you will of course have to have called the
kAudioOutputUnitProperty_EnableIO property to enable the input side of
the AU.

Bill

On 14/01/2004, at 12:31 PM, Robert Grant wrote:

> Hi Brad,
>
> Can you post some code about how to configure the HALOutputUnit for
> input - I'm trying to get it working but I'm getting nowhere.
>
> Also can you tell us the method of determining whether to use
> AudioUnitRender or the SetInputCallback approach?
>
> Thanks,
>
> Robert.
>
> On Jan 14, 2004, at 12:29 PM, Brad Ford wrote:
>
>> Hugues,
>> You want the HAL AudioOutputUnit.
>>
>> ComponentDescription cd = {kAudioUnitType_Output,
>> kAudioUnitSubType_HALOutput, kAudioUnitManufacturer_Apple, 0, 0};
>> Component c = FindNextComponent(nil, &cd);
>>
>> "But I want input, not output," you say. And I reply, "It was named
>> an output unit before it could do input. Now it should be thought of
>> as an AudioInputOrOutputOrBothUnit."
>>
>> When opened, it's configured for output only. You have to set
>> kAudioOutputUnitProperty_EnableIO to enable the input side (or
>> disable the output side). Search the archives of this list. This
>> has been discussed before.
>>
>> -Brad
>>
>> On Jan 14, 2004, at 12:50 AM, Hugues Pisapia wrote:
>>
>>> Hi there,
>>>
>>> Well... this is maybe a stupid question, but I prefer to ask it
>>> anyway:
>>> I am not able to find an AU to get audio data from a device. Does it
>>> exist?
>>>
>>> Thanks,
>>> Hugues
>>> _______________________________________________
>>> 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.
>> _______________________________________________
>> 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.
> _______________________________________________
> 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.
>
>
--
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
________________________________________________________________________
__
_______________________________________________
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: 
 >Input AudioUnit? (From: Hugues Pisapia <email@hidden>)
 >Re: Input AudioUnit? (From: Brad Ford <email@hidden>)
 >Re: Input AudioUnit? (From: Robert Grant <email@hidden>)

  • Prev by Date: Re: stuck on audio streams
  • Next by Date: Re: HALOutputUnit (Pt 1)
  • Previous by thread: Re: Input AudioUnit?
  • Next by thread: stuck on audio streams
  • Index(es):
    • Date
    • Thread