views:

669

answers:

2

Hello,

I am using Stephen Celis' SCListener class (for iPhone) to "listen" from the microphone, but I also need to be playing music at the same time using the MediaPlayer framework. However, when I start listening with SCListener, the music fades out and stops. I have set the kAudioSessionCategory_PlayAndRecord property on the audio session in SCListener, which should allow me to play audio and record audio at the same time, but as far as I can tell it has no effect. I'm confused, because according to other developers' results, this works just fine, but not for me. I'm thinking maybe the kAudioSessionCategory_PlayAndRecord property allows you to play sound and record if you're using the AVAudioPlayer framework or something to play the sound, but maybe not the MediaPlayer framework? This would be a problem for me because I need to play music from the user's iPod library, which, as far as I know is only possible to do using the MediaPlayer framework.

Does anyone know how I can get around this problem? Thanks in advance!

A: 

Hi Earnon,

Did you happen to solve this issue? I am facing the same problem. Please let me know if there is any solution. Thanks CHAU

AlexanderDeep
A: 

Unfortunately I still haven't found a solution to this problem. But after lots of testing, I'm pretty sure it's not possible to record sound while playing music with the MediaPlayer API, although if you use a different API to play sound, i.e. AVAudioPlayer, it usually does work. MediaPlayer is the only API that can play iPod music though.