Re: How to monitor what is being recorded?
Re: How to monitor what is being recorded?
- Subject: Re: How to monitor what is being recorded?
- From: "Roni Music" <email@hidden>
- Date: Fri, 11 Jun 2004 09:15:04 +0200
----- Original Message -----
From: "William Stewart" <email@hidden>
To: "Rolf Nilsson" <email@hidden>
Cc: <email@hidden>
Sent: Thursday, June 10, 2004 4:02 AM
Subject: Re: How to monitor what is being recorded?
>
What's the failure case when you set the connection?
There is no failure but also no sound so it seems there is something I do not understand?
When I set up the connection below, I expect that whatever arrives at the input (bus 1?) is also sent to the output device at bus 0?
AudioUnitConnection connection;
connection.sourceAudioUnit = theInputUnit;
connection.sourceOutputNumber = 1;
connection.destInputNumber = 0;
AudioUnitSetProperty( theOutputUnit, kAudioUnitProperty_MakeConnection, kAudioUnitScope_Input,
0/*inElement*/, &connection, sizeof(AudioUnitConnection));
But if I make the connection, the render callback for the output is never called.
So when I make the connection does that mean that there is no need for the render callback?
The output unit works fine by itself (trying it with a simple sinus tone) and is created with
kAudioUnitType_Output, kAudioUnitSubType_HALOutput and kAudioUnitManufactor_Apple
then
FinNextComponent() and OpenAComponent()
then
_SetRenderCallback
and _StreamFormat to the sames as the input
and lastly _MakeConnection as above and AudioUnitInitialize()
The InputDevice is set up exactly as in your CAAudioFileRecorder example (the output is disabled and the input is enabled)
Is there any example of playthru with kAudioUnitProperty_MakeConnection in the develop examples?
Any help appreciated
Rolf
>
>
Bill
>
>
On 09/06/2004, at 1:18 PM, Rolf Nilsson wrote:
>
>
>
>
>
>
> Thanks for replying!
>
>
>
>
>
> > To monitor what is going out - lets say (like Chilton's previous
>
> > example) that you've established a connection between the AUHAL
>
> (input)
>
> > to something to AUHAL for output...
>
>
>
> Maybe the word "monitor" is not what I mean?
>
> I want what is coming in at the input should be sent to the output.
>
>
>
> Is it possible to make a connection between the input and output like
>
> this (it does not work as I try it)
>
>
>
> AudioUnitConnection connection;
>
> connection.sourceAudioUnit = theInputUnit;
>
> connection.sourceOutputNumber = 1;
>
> connection.destInputNumber = 0;
>
> AudioUnitSetProperty( theOutputUnit,
>
> kAudioUnitProperty_MakeConnection, kAudioUnitScope_Input,
>
> 0/*inElement*/, &connection, sizeof(AudioUnitConnection));
>
>
>
>
>
> or
>
>
>
> must I transfer the incoming data from the input callback to the
>
> output callback via a queue/ringbuffer
>
> as in the /CoreAudio/HAL/AudioThru example?
>
>
>
>
>
> >
>
> > You can attach a render notification to the AUHAL - that gets called
>
> > whenever it renders (which is every I/O cycle)... In the AUHAL case
>
> > (because the same AU is doing input as well as output) you should
>
> check
>
> > the bus (element) number in the notification.
>
> >
>
> > When you see both:
>
> > post render flag
>
> > and
>
> > bus zero
>
> >
>
> > then the ABL that is passed to the render notification contains the
>
> > audio data that will then be fed to the device.
>
>
>
> I did set up a render notification with AudioUnitAddRenderNotify() for
>
> the output device (or should it be the input device?)
>
> and in the notification callback I check for
>
>
>
> if ( (*ioActionFlags & kAudioUnitRenderAction_PostRender) &&
>
> (inBusNumber == 0))
>
> {
>
> // what do I do here?
>
> }
>
>
>
>
>
> >
>
> > Does that make sense?
>
>
>
> Not sure? I guess I'm a bit confused?
>
>
>
> I just want the sound from the default input device to be sent to the
>
> default output device (play thru)
>
>
>
> Rolf
_______________________________________________
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.