If the device has a microphone, I would create audio device as "play and record". If the microphone is not available, only "play" audio device can work.
views:
31answers:
1Thanks! I think I got the answer. NSError *error; AVAudioSession *audioSession = [AVAudioSession sharedInstance]; if (![audioSession setCategory:AVAudioSessionCategoryPlayAndRecord error: } // mix audio with others, such as iPod etc. UInt32 doSetProperty = 1; AudioSessionSetProperty (kAudioSessionProperty_OtherMixableAudioShouldDuck, sizeof(doSetProperty), if (![audioSession setActive:YES error: } return audioSession.inputIsAvailable;
MQ Gu
2010-08-08 14:57:11
Sorry, the code is a little bit mess. You can copy it to Xcode and indent it.
MQ Gu
2010-08-08 15:03:01