Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AVCaptureSession cancels background audio

Whenever I start an AVCaptureSession running with the microphone as an input it cancels whatever background music is currently running (iPod music for instance). If I comment out the line adding the audio input, the background audio continues.

Does anyone know of a way to record video clips with the microphone while continuing to allow background audio to play? I've looked around a lot, and can't seem to find any references to this behavior.

Thanks for any help!

like image 603
Edmond Avatar asked Aug 16 '10 05:08

Edmond


2 Answers

Try setting kAudioSessionProperty_OverrideCategoryMixWithOthers as seen in https://stackoverflow.com/a/7426406/16572

like image 159
kalperin Avatar answered Nov 14 '22 02:11

kalperin


Is the background music a looping track? -- if so you could make it a system sound and tell it to re-play when it finishes playing. The reason being you can only have tracks up to 30 seconds as a system sound.

Don't know if it helps -- but thats one approach :)

Cheers,

Michael

like image 1
Michael O'Brien Avatar answered Nov 14 '22 02:11

Michael O'Brien