Using remote io for recording and AVPlayer for playing ipod library audio at the same time continuously

602 views Asked by At

Can I use remote io for recording and AVPlayer for playing iPod library audio at the same time continuously?

I tried but the error returned was:

AURemoteIO::ChangeHardwareFormats: error -10875.
2

There are 2 answers

2
bitmapdata.com On

As far as I know, officially it is not possible. When you start the recording sessions, except for recording does not occupy it. Once you playback and recording sessions in the session must be solved. recording and playback session, the session can not be occupied simultaneously.

refer a apple documentation: Audio Session

AVAudioSessionCategoryPlayAndRecord or the equivalent kAudioSessionCategory_PlayAndRecord—Use this category for an application that inputs and outputs audio. The input and output need not occur simultaneously, but can if needed. This is the category to use for audio chat applications.

0
Scrooch On

Yes it is possible. I suggest downloading this example app: http://zerokidz.com/audiograph/Home.html audioGraph. Then attempting to play an audio file with AVPlayer while the mic is enabled. I found that it is possible, but it depends on the file format of audio you want to play with AVPlayer.

For example, I found that if you have an InputCallback at 44800hz and attempt to play an audiofile with AVPlayer that is 44100hz, you will start receiving errors in the InputCallback. But if you play an 48000hz file, it will work fine.