Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What's the difference with render callback function and input callback function

Although I searched in the Internet, I still can't find any answer to my question. I see there are two kinds of callback functions, and as the describe of audio unit properties, one is called inputcallback function and the other is called rendercallback function.

@constant       kAudioOutputUnitProperty_SetInputCallback
@discussion         Scope: Global
                    Value Type: AURenderCallbackStruct
                    Access: read/write


@constant       kAudioUnitProperty_SetRenderCallback
                    Scope:          Input
                    Value Type:     AURenderCallbackStruct
                    Access:         Write

I don't know what's the difference between these two, and when or which shall I pick each of it. if there is anyone know about it, please help me.

Maybe it's not a difficult question, but I can't solve it for few days. Thank you very much.

like image 560
nekonosukiyaki Avatar asked Dec 22 '14 07:12

nekonosukiyaki


1 Answers

kAudioOutputUnitProperty_SetInputCallback is used when the microphone takes in data, this allows you to dictate what you want to do with that data. In this call back you write where you want to put that data.

kAudioUnitProperty_SetRenderCallback you will often see the term "pull" with this one. This is used when the speakers needs more data to output to the speakers. So it will pull in the audio data that you provide in that callback.

like image 147
cvu Avatar answered Oct 29 '22 16:10

cvu