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 に答える