0
@constant       kAudioSessionProperty_AudioInputAvailable 
                    A UInt32 with a value other than zero when audio input is available.
                    Use this property, rather than the device model, to determine if audio input is available.
                    A listener will notify you when audio input becomes available.  For instance, when a headset is attached
                    to the second generation iPod Touch, audio input becomes available via the wired microphone. 

那么,如果我想收到有关 kAudioSessionProperty_AudioInputAvailable 的通知,我该怎么做呢?

4

1 回答 1

2

您像这样设置侦听器:

AudioSessionAddPropertyListener(kAudioSessionProperty_AudioInputAvailable, myCallback, NULL);

您必须定义一个回调函数,该函数在值更改时被调用:

void myCallback(void* inClientData, AudioSessionPropertyID inID, UInt32 inDataSize, const void* inData)
{
    printf("value changed\n");
}
于 2010-05-02T17:03:43.527 回答